androidx.activity.result

Classes

ActivityResult

A container for an activity result as obtained form Activity#onActivityResult

ActivityResultLauncher

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

ActivityResultRegistry

A registry that stores activity result callbacks for registered calls.

IntentSenderRequest

A request for a androidx.activity.result.contract.ActivityResultContracts.StartIntentSenderForResult Activity Contract.

Extension functions summary

For ActivityResultLauncher
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.

For ActivityResultCaller
() -> Unit
ActivityResultCaller.registerForActivityResult(contract: ActivityResultContract<I, O>, input: I, registry: ActivityResultRegistry, crossinline callback: (O) -> Unit)

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

() -> Unit
ActivityResultCaller.registerForActivityResult(contract: ActivityResultContract<I, O>, input: I, crossinline callback: (O) -> Unit)

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

Extension functions

launch

fun ActivityResultLauncher<Void?>.launch(options: ActivityOptionsCompat? = null): Unit

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

launch

@JvmName("launchUnit") fun ActivityResultLauncher<Unit>.launch(options: ActivityOptionsCompat? = null): Unit

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

registerForActivityResult

inline fun <I, O> ActivityResultCaller.registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    input: I,
    registry: ActivityResultRegistry,
    crossinline callback: (O) -> Unit
): () -> Unit

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.

registerForActivityResult

inline fun <I, O> ActivityResultCaller.registerForActivityResult(
    contract: ActivityResultContract<I, O>,
    input: I,
    crossinline callback: (O) -> Unit
): () -> Unit

A version of ActivityResultCaller.registerForActivityResult that additionally takes an input right away, producing a launcher that doesn't take any additional input when called.