ActivityResultLauncher

public abstract class ActivityResultLauncher<I>


A launcher for a previously-prepared call to start the process of executing an ActivityResultContract.

Parameters
<I>

type of the input required to launch

Summary

Public constructors

Public methods

abstract @NonNull ActivityResultContract<I, Object>

Get the ActivityResultContract that was used to create this launcher.

void
launch(I input)

Executes an ActivityResultContract.

abstract void
launch(I input, @Nullable ActivityOptionsCompat options)

Executes an ActivityResultContract.

abstract @MainThread void

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

Extension functions

final void

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

final void

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

Public constructors

ActivityResultLauncher

public final ActivityResultLauncher()

Public methods

getContract

public abstract @NonNull ActivityResultContract<I, ObjectgetContract()

Get the ActivityResultContract that was used to create this launcher.

Returns
@NonNull ActivityResultContract<I, Object>

the contract that was used to create this launcher

launch