StartActivityForResult
class StartActivityForResult : ActivityResultContract<Intent!, ActivityResult!>
An ActivityResultContract
that doesn't do any type conversion, taking raw Intent
as an input and ActivityResult
as an output. Can be used with ActivityResultCaller#registerForActivityResult to avoid having to manage request codes when calling an activity API for which a type-safe contract is not available.
Summary
Constants | |
---|---|
static String |
Key for the extra containing a |
Public constructors | |
---|---|
<init>() An |
Public methods | |
---|---|
Intent |
createIntent(@NonNull context: Context, @NonNull input: Intent) |
ActivityResult |
parseResult(resultCode: Int, @Nullable intent: Intent?) |
Inherited functions | |
---|---|
Constants
EXTRA_ACTIVITY_OPTIONS_BUNDLE
static val EXTRA_ACTIVITY_OPTIONS_BUNDLE: String
Key for the extra containing a android.os.Bundle
generated from androidx.core.app.ActivityOptionsCompat#toBundle()
or android.app.ActivityOptions#toBundle()
. This will override any ActivityOptionsCompat
passed to androidx.activity.result.ActivityResultLauncher#launch(Object, ActivityOptionsCompat)
Value: "androidx.activity.result"
+ ".contract.extra.ACTIVITY_OPTIONS_BUNDLE"
Public constructors
<init>
StartActivityForResult()
An ActivityResultContract
that doesn't do any type conversion, taking raw Intent
as an input and ActivityResult
as an output. Can be used with ActivityResultCaller#registerForActivityResult to avoid having to manage request codes when calling an activity API for which a type-safe contract is not available.
Public methods
parseResult
@NonNull fun parseResult(
resultCode: Int,
@Nullable intent: Intent?
): ActivityResult