ActivityResultContracts.StartIntentSenderForResult

public final class ActivityResultContracts.StartIntentSenderForResult extends ActivityResultContract


An ActivityResultContract that calls startIntentSender. This ActivityResultContract takes an IntentSenderRequest, which must be constructed using an IntentSenderRequest.Builder. If the call to startIntentSenderForResult throws an android.content.IntentSender.SendIntentException the androidx.activity.result.ActivityResultCallback will receive an ActivityResult with an RESULT_CANCELED{@code 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 final @NonNull String

An Intent action for making a request via the startIntentSenderForResult API.

static final @NonNull String

Key for the extra containing the IntentSenderRequest.

static final @NonNull String

Key for the extra containing the android.content.IntentSender.SendIntentException if the call to startIntentSenderForResult fails.

Public methods

@NonNull @Override Intent

Create an intent that can be used for startActivityForResult

@NonNull @Override ActivityResult
parseResult(@NonNull int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O

Inherited methods

From class ActivityResultContract
@Nullable ActivityResultContract.SynchronousResult<@NonNull O>

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

Constants

ACTION_INTENT_SENDER_REQUEST

@NonNull
public static final @NonNull String ACTION_INTENT_SENDER_REQUEST

An Intent action for making a request via the startIntentSenderForResult API.

EXTRA_INTENT_SENDER_REQUEST

@NonNull
public static final @NonNull String EXTRA_INTENT_SENDER_REQUEST

Key for the extra containing the IntentSenderRequest.

See also
ACTION_INTENT_SENDER_REQUEST

#ACTION_INTENT_SENDER_REQUEST

EXTRA_SEND_INTENT_EXCEPTION

@NonNull
public static final @NonNull String EXTRA_SEND_INTENT_EXCEPTION

Key for the extra containing the android.content.IntentSender.SendIntentException if the call to startIntentSenderForResult fails.

Public methods

createIntent

@NonNull
@Override
public @Override Intent createIntent(@NonNull Context context, @NonNull IntentSenderRequest input)

Create an intent that can be used for startActivityForResult

parseResult

@NonNull
@Override
public @Override ActivityResult parseResult(@NonNull int resultCode, @Nullable Intent intent)

Convert result obtained from onActivityResult to O