StartIntentSenderForResult
class StartIntentSenderForResult : ActivityResultContract<IntentSenderRequest!, ActivityResult!>
An ActivityResultContract
that calls Activity#startIntentSender(IntentSender, Intent, int, int, int). This ActivityResultContract
takes an IntentSenderRequest
, which must be constructed using an IntentSenderRequest.Builder
. If the call to Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)
throws an android.content.IntentSender.SendIntentException
the androidx.activity.result.ActivityResultCallback
will receive an ActivityResult
with an Activity#RESULT_CANCELED
resultCode
and whose intent has the action
of ACTION_INTENT_SENDER_REQUEST
and an extra EXTRA_SEND_INTENT_EXCEPTION
that contains the thrown exception.
Summary
Constants | |
---|---|
static String |
An |
static String |
Key for the extra containing the |
static String |
Key for the extra containing the |
Public constructors | |
---|---|
<init>() An |
Public methods | |
---|---|
Intent |
createIntent(@NonNull context: Context, @NonNull input: IntentSenderRequest) |
ActivityResult |
parseResult(resultCode: Int, @Nullable intent: Intent?) |
Inherited functions | |
---|---|
Constants
ACTION_INTENT_SENDER_REQUEST
static val ACTION_INTENT_SENDER_REQUEST: String
An Intent
action for making a request via the Activity#startIntentSenderForResult API.
Value: "androidx.activity.result"
+ ".contract.action.INTENT_SENDER_REQUEST"
EXTRA_INTENT_SENDER_REQUEST
static val EXTRA_INTENT_SENDER_REQUEST: String
Key for the extra containing the IntentSenderRequest
.
Value: "androidx.activity.result"
+ ".contract.extra.INTENT_SENDER_REQUEST"
See Also
EXTRA_SEND_INTENT_EXCEPTION
static val EXTRA_SEND_INTENT_EXCEPTION: String
Key for the extra containing the android.content.IntentSender.SendIntentException
if the call to Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)
fails.
Value: "androidx.activity.result"
+ ".contract.extra.SEND_INTENT_EXCEPTION"
Public constructors
<init>
StartIntentSenderForResult()
An ActivityResultContract
that calls Activity#startIntentSender(IntentSender, Intent, int, int, int). This ActivityResultContract
takes an IntentSenderRequest
, which must be constructed using an IntentSenderRequest.Builder
. If the call to Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)
throws an android.content.IntentSender.SendIntentException
the androidx.activity.result.ActivityResultCallback
will receive an ActivityResult
with an Activity#RESULT_CANCELED
resultCode
and whose intent has the action
of ACTION_INTENT_SENDER_REQUEST
and an extra EXTRA_SEND_INTENT_EXCEPTION
that contains the thrown exception.
Public methods
createIntent
@NonNull fun createIntent(
@NonNull context: Context,
@NonNull input: IntentSenderRequest
): Intent
parseResult
@NonNull fun parseResult(
resultCode: Int,
@Nullable intent: Intent?
): ActivityResult