ActivityResultContracts.StartIntentSenderForResult


class ActivityResultContracts.StartIntentSenderForResult : 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_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

const String

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

const String

Key for the extra containing the IntentSenderRequest.

const String

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

Public constructors

Public functions

open Intent

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

open ActivityResult
parseResult(resultCode: Int, intent: Intent?)

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

Inherited functions

From androidx.activity.result.contract.ActivityResultContract
open ActivityResultContract.SynchronousResult<ActivityResult>?

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

const val ACTION_INTENT_SENDER_REQUESTString

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

EXTRA_INTENT_SENDER_REQUEST

const val EXTRA_INTENT_SENDER_REQUESTString

Key for the extra containing the IntentSenderRequest.

EXTRA_SEND_INTENT_EXCEPTION

const val EXTRA_SEND_INTENT_EXCEPTIONString

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

Public constructors

StartIntentSenderForResult

Added in 1.2.0
StartIntentSenderForResult()

Public functions

createIntent

Added in 1.2.0
open fun createIntent(context: Context, input: IntentSenderRequest): Intent

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

parseResult

open fun parseResult(resultCode: Int, intent: Intent?): ActivityResult

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