# ActivityResultContracts.StartIntentSenderForResult

Artifact: [androidx.activity:activity](https://developer.android.com/jetpack/androidx/releases/activity) [View Source](https://cs.android.com/search?q=file:androidx/activity/result/contract/ActivityResultContracts.kt+class:androidx.activity.result.contract.ActivityResultContracts.StartIntentSenderForResult) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

*** ** * ** ***


```
public final class ActivityResultContracts.StartIntentSenderForResult extends ActivityResultContract<@NonNull IntentSenderRequest, @NonNull ActivityResult>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [IntentSenderRequest](https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest), @[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) [ActivityResult](https://developer.android.com/reference/androidx/activity/result/ActivityResult)\> ||
|   | ↳ | [androidx.activity.result.contract.ActivityResultContracts.StartIntentSenderForResult](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult) |

*** ** * ** ***

An `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` that calls `https://developer.android.com/reference/android/app/Activity.html#startIntentSender(android.content.IntentSender, android.content.Intent, int, int, int)`.

This `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` takes an `https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest`, which must be constructed using an `https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest.Builder`.

If the call to `https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)` throws an `https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html` the `https://developer.android.com/reference/androidx/activity/result/ActivityResultCallback` will receive an `https://developer.android.com/reference/androidx/activity/result/ActivityResult` with an `https://developer.android.com/reference/android/app/Activity.html#RESULT_CANCELED` `resultCode` and whose intent has the `https://developer.android.com/reference/android/content/Intent.html#getAction()` of `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#ACTION_INTENT_SENDER_REQUEST()` and an extra `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#EXTRA_SEND_INTENT_EXCEPTION()` that contains the thrown exception.

## Summary

| ### Constants |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#ACTION_INTENT_SENDER_REQUEST()` An `https://developer.android.com/reference/android/content/Intent.html` action for making a request via the `https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)` API. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#EXTRA_INTENT_SENDER_REQUEST()` Key for the extra containing the `https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#EXTRA_SEND_INTENT_EXCEPTION()` Key for the extra containing the `https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html` if the call to `https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)` fails. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#StartIntentSenderForResult()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#createIntent(android.content.Context,androidx.activity.result.IntentSenderRequest)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest input)` Create an intent that can be used for `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/ActivityResult` | `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#parseResult(kotlin.Int,android.content.Intent)(int resultCode, https://developer.android.com/reference/android/content/Intent.html intent)` Convert result obtained from `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` to `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`. |

### Inherited methods

From [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract) `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract.SynchronousResult<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/ActivityResult>` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract#getSynchronousResult(android.content.Context,kotlin.Any)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context,
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest input
)`

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

```
public static final @NonNull String ACTION_INTENT_SENDER_REQUEST
```

An `https://developer.android.com/reference/android/content/Intent.html` action for making a request via the `https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)` API.

### EXTRA_INTENT_SENDER_REQUEST

```
public static final @NonNull String EXTRA_INTENT_SENDER_REQUEST
```

Key for the extra containing the `https://developer.android.com/reference/androidx/activity/result/IntentSenderRequest`.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#ACTION_INTENT_SENDER_REQUEST()` |   |

### EXTRA_SEND_INTENT_EXCEPTION

```
public static final @NonNull String EXTRA_SEND_INTENT_EXCEPTION
```

Key for the extra containing the `https://developer.android.com/reference/android/content/IntentSender.SendIntentException.html` if the call to `https://developer.android.com/reference/android/app/Activity.html#startIntentSenderForResult(android.content.IntentSender, int, android.content.Intent, int, int, int)` fails.

## Public constructors

### StartIntentSenderForResult

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

```
public StartIntentSenderForResult()
```

## Public methods

### createIntent

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/activity#1.2.0)

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

Create an intent that can be used for `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`.

### parseResult

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

Convert result obtained from `https://developer.android.com/reference/android/app/Activity.html#onActivityResult(int, int, android.content.Intent)` to `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract`.