# 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)

*** ** * ** ***


```
class ActivityResultContracts.StartIntentSenderForResult : ActivityResultContract<IntentSenderRequest, ActivityResult>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContract)\<[IntentSenderRequest](https://developer.android.com/reference/kotlin/androidx/activity/result/IntentSenderRequest), [ActivityResult](https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult)\> ||
|   | ↳ | [androidx.activity.result.contract.ActivityResultContracts.StartIntentSenderForResult](https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult) |

*** ** * ** ***

An `https://developer.android.com/reference/kotlin/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/kotlin/androidx/activity/result/contract/ActivityResultContract` takes an `https://developer.android.com/reference/kotlin/androidx/activity/result/IntentSenderRequest`, which must be constructed using an `https://developer.android.com/reference/kotlin/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/kotlin/androidx/activity/result/ActivityResultCallback` will receive an `https://developer.android.com/reference/kotlin/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/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#ACTION_INTENT_SENDER_REQUEST()` and an extra `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#EXTRA_SEND_INTENT_EXCEPTION()` that contains the thrown exception.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/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. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#EXTRA_INTENT_SENDER_REQUEST()` Key for the extra containing the `https://developer.android.com/reference/kotlin/androidx/activity/result/IntentSenderRequest`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/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/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#StartIntentSenderForResult()()` |

| ### Public functions |
|---|---|
| `open https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#createIntent(android.content.Context,androidx.activity.result.IntentSenderRequest)(context: https://developer.android.com/reference/android/content/Context.html, input: https://developer.android.com/reference/kotlin/androidx/activity/result/IntentSenderRequest)` Create an intent that can be used for `https://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)`. |
| `open https://developer.android.com/reference/kotlin/androidx/activity/result/ActivityResult` | `https://developer.android.com/reference/kotlin/androidx/activity/result/contract/ActivityResultContracts.StartIntentSenderForResult#parseResult(kotlin.Int,android.content.Intent)(resultCode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, intent: https://developer.android.com/reference/android/content/Intent.html?)` 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/kotlin/androidx/activity/result/contract/ActivityResultContract`. |

### Inherited functions

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

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_REQUEST: String
```

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

```
const val EXTRA_INTENT_SENDER_REQUEST: String
```

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

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

### EXTRA_SEND_INTENT_EXCEPTION

```
const val EXTRA_SEND_INTENT_EXCEPTION: String
```

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)

```
StartIntentSenderForResult()
```

## Public functions

### createIntent

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

```
open fun createIntent(context: Context, input: IntentSenderRequest): Intent
```

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

### parseResult

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

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/kotlin/androidx/activity/result/contract/ActivityResultContract`.