ActivityResultContracts.StartIntentSenderForResult
public
static
final
class
ActivityResultContracts.StartIntentSenderForResult
extends ActivityResultContract<IntentSenderRequest, ActivityResult>
java.lang.Object | ||
↳ | androidx.activity.result.contract.ActivityResultContract<androidx.activity.result.IntentSenderRequest, androidx.activity.result.ActivityResult> | |
↳ | androidx.activity.result.contract.ActivityResultContracts.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 IntentSender.SendIntentException
the
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 | |
---|---|
String |
ACTION_INTENT_SENDER_REQUEST
An |
String |
EXTRA_INTENT_SENDER_REQUEST
Key for the extra containing the |
String |
EXTRA_SEND_INTENT_EXCEPTION
Key for the extra containing the |
Public constructors | |
---|---|
StartIntentSenderForResult()
|
Public methods | |
---|---|
Intent
|
createIntent(Context context, IntentSenderRequest input)
Create an intent that can be used for |
ActivityResult
|
parseResult(int resultCode, Intent intent)
Convert result obtained from |
Inherited methods | |
---|---|
Constants
ACTION_INTENT_SENDER_REQUEST
public static final String ACTION_INTENT_SENDER_REQUEST
An Intent
action for making a request via the
Activity.startIntentSenderForResult(IntentSender, int, Intent, int, int, int)
API.
Constant Value: "androidx.activity.result.contract.action.INTENT_SENDER_REQUEST"
EXTRA_INTENT_SENDER_REQUEST
public static final String EXTRA_INTENT_SENDER_REQUEST
Key for the extra containing the IntentSenderRequest
.
See also:
Constant Value: "androidx.activity.result.contract.extra.INTENT_SENDER_REQUEST"
EXTRA_SEND_INTENT_EXCEPTION
public static final String EXTRA_SEND_INTENT_EXCEPTION
Key for the extra containing the IntentSender.SendIntentException
if the call to
Activity.startIntentSenderForResult(IntentSender, int, Intent, int, int, int)
fails.
Constant Value: "androidx.activity.result.contract.extra.SEND_INTENT_EXCEPTION"
Public constructors
StartIntentSenderForResult
public StartIntentSenderForResult ()
Public methods
createIntent
public Intent createIntent (Context context, IntentSenderRequest input)
Create an intent that can be used for Activity.startActivityForResult(Intent, int)
Parameters | |
---|---|
context |
Context |
input |
IntentSenderRequest |
Returns | |
---|---|
Intent |
parseResult
public ActivityResult parseResult (int resultCode, Intent intent)
Convert result obtained from Activity.onActivityResult(int, int, Intent)
to O
Parameters | |
---|---|
resultCode |
int |
intent |
Intent |
Returns | |
---|---|
ActivityResult |