ActivityResultContracts.StartIntentSenderForResult

public final class ActivityResultContracts.StartIntentSenderForResult extends ActivityResultContract


An ActivityResultContract that calls Activity.startIntentSender.

This ActivityResultContract takes an IntentSenderRequest, which must be constructed using an IntentSenderRequest.Builder.

If the call to Activity.startIntentSenderForResult throws an android.content.IntentSender.SendIntentException the androidx.activity.result.ActivityResultCallback will receive an ActivityResult with an Activity.RESULT_CANCELEDresultCode and whose intent has the action of ACTION_INTENT_SENDER_REQUEST and an extra EXTRA_SEND_INTENT_EXCEPTION that contains the thrown exception.

Summary

Public constructors

Public methods

@NonNull Intent

Create an intent that can be used for android.app.Activity.startActivityForResult.

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

Convert result obtained from android.app.Activity.onActivityResult to O.

Inherited methods

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

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

Public constructors

StartIntentSenderForResult

public final StartIntentSenderForResult()

Public methods

createIntent

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

Create an intent that can be used for android.app.Activity.startActivityForResult.

parseResult

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

Convert result obtained from android.app.Activity.onActivityResult to O.