ActivityResultContract
abstract class ActivityResultContract<I : Any!, O : Any!>
kotlin.Any | |
↳ | androidx.activity.result.contract.ActivityResultContract |
A contract specifying that an activity can be called with an input of type I and produce an output of type O Makes calling an activity for result type-safe.
Summary
Nested classes | |
---|---|
The wrapper for a result provided in |
Public constructors | |
---|---|
<init>() A contract specifying that an activity can be called with an input of type I and produce an output of type O Makes calling an activity for result type-safe. |
Public methods | |
---|---|
abstract Intent |
createIntent(@NonNull context: Context, input: I) Create an intent that can be used for Activity#startActivityForResult |
open ActivityResultContract.SynchronousResult<O>? |
getSynchronousResult(@NonNull context: Context, input: I) An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity. |
abstract O |
parseResult(resultCode: Int, @Nullable intent: Intent?) Convert result obtained from |
Public constructors
<init>
ActivityResultContract()
A contract specifying that an activity can be called with an input of type I and produce an output of type O Makes calling an activity for result type-safe.
See Also
Public methods
createIntent
@NonNull abstract fun createIntent(
@NonNull