Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

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.