ActivityResultLauncher
abstract class ActivityResultLauncher<I : Any?>
ManagedActivityResultLauncher |
A launcher for a previously- |
A launcher for a previously-prepared call to start the process of executing an ActivityResultContract that takes an I as its required input.
Summary
Public constructors |
|---|
<I : Any?> ActivityResultLauncher() |
Public functions |
|
|---|---|
open Unit |
launch(input: I)Executes an |
abstract Unit |
launch(input: I, options: ActivityOptionsCompat?)Executes an |
abstract Unit |
Unregisters this launcher, releasing the underlying result callback, and any references captured within it. |
Public properties |
|
|---|---|
abstract ActivityResultContract<I, *> |
Returns the |
Extension functions |
|
|---|---|
Unit |
ActivityResultLauncher<Void?>.launch(options: ActivityOptionsCompat?)Convenience method to launch a no-argument registered call without needing to pass in |
Unit |
ActivityResultLauncher<Unit>.launch(options: ActivityOptionsCompat?)Convenience method to launch a no-argument registered call without needing to pass in |
Public constructors
Public functions
launch
open fun launch(input: I): Unit
Executes an ActivityResultContract given the required input.
This method throws android.content.ActivityNotFoundException if there was no Activity found to run the given Intent.
launch
abstract fun launch(input: I, options: ActivityOptionsCompat?): Unit
Executes an ActivityResultContract given the required input and optional options for how the Activity should be started.
This method throws android.content.ActivityNotFoundException if there was no Activity found to run the given Intent.
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.
Public properties
contract
abstract val contract: ActivityResultContract<I, *>
Returns the ActivityResultContract that was used to create this launcher.
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
fun ActivityResultLauncher<Unit>.launch(
options: ActivityOptionsCompat? = null
): Unit
Convenience method to launch a no-argument registered call without needing to pass in Unit.