Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

ActivityResultLauncher

abstract class ActivityResultLauncher<I : Any!>
kotlin.Any
   ↳ androidx.activity.result.ActivityResultLauncher

A launcher for a previously-ActivityResultCaller#registerForActivityResult to start the process of executing an ActivityResultContract.

Summary

Public constructors

A launcher for a previously-ActivityResultCaller#registerForActivityResult to start the process of executing an ActivityResultContract.

Public methods
abstract ActivityResultContract<I, *>

Get the ActivityResultContract that was used to create this launcher.

open Unit
launch(input: I)

Executes an ActivityResultContract.

abstract Unit
launch(input: I, @Nullable options: ActivityOptionsCompat?)

Executes an ActivityResultContract.

abstract Unit

Unregisters this launcher, releasing the underlying result callback, and any references captured within it.

Extension functions
From androidx.activity.result
Unit

Convenience method to launch a no-argument registered call without needing to pass in null.

Unit

Convenience method to launch a no-argument registered call without needing to pass in Unit.

Public constructors

<init>

ActivityResultLauncher()

A launcher for a previously-ActivityResultCaller#registerForActivityResult to start the process of executing an ActivityResultContract.

Public methods

getContract

@NonNull abstract fun getContract(): ActivityResultContract<I, *>

Get the ActivityResultContract that was used to create this launcher.

Return
ActivityResultContract<I, *> the contract that was used to create this launcher

launch

open fun launch(input: I): Unit

Executes an ActivityResultContract.

Parameters
input I: the input required to execute an ActivityResultContract.

launch

abstract fun launch(
    input: I,
    @Nullable options: ActivityOptionsCompat?
): Unit

Executes an ActivityResultContract.

Parameters
input I: the input required to execute an ActivityResultContract.
options ActivityOptionsCompat?: Additional options for how the Activity should be started.

unregister

@MainThread abstract fun unregister(): Unit

Unregisters this launcher, releasing the underlying result callback, and any references captured within it. You should call this if the registry may live longer than the callback registered for this launcher.