Added in [API level 37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.app.AppInteractionSession.CreateParams.Builder](https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#) |

Builder for `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#Builder()()` Constructor for `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#`. |

| Public methods ||
|---|---|
| [AppInteractionSession.CreateParams](https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams) | `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#build()()` Builds the `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams`. |
| [AppInteractionSession.CreateParams.Builder](https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#) | `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#setExtras(android.os.Bundle)(extras: https://developer.android.com/reference/kotlin/android/os/Bundle.html#)` Sets the additional metadata for this session. |
| [AppInteractionSession.CreateParams.Builder](https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#) | `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#setOnStartIntentSenderCallback(java.util.concurrent.Executor,%20java.util.function.Consumer)(executor: https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#, callback: https://developer.android.com/reference/kotlin/java/util/function/Consumer.html#<https://developer.android.com/reference/kotlin/android/content/IntentSender.html#!>)` Called when the session creation needs to be approved by the user. |
| [AppInteractionSession.CreateParams.Builder](https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#) | `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#setTargetPackages(kotlin.collections.MutableList)(targetPackages: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!>)` Sets the target packages for which the app interaction session will be interacting with. |

## Public constructors

### Builder

Added in [API level 37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Builder()
```

Constructor for `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#`.

## Public methods

### build

Added in [API level 37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun build(): AppInteractionSession.CreateParams
```

Builds the `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams`.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams` | This value cannot be `null`. |

### setExtras

Added in [API level 37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setExtras(extras: Bundle): AppInteractionSession.CreateParams.Builder
```

Sets the additional metadata for this session.

| Parameters ||
|---|---|
| `extras` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#): The additional metadata for this session. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#` | This value cannot be `null`. |

### setOnStartIntentSenderCallback

Added in [API level 37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setOnStartIntentSenderCallback(
    executor: Executor, 
    callback: Consumer<IntentSender!>
): AppInteractionSession.CreateParams.Builder
```

Called when the session creation needs to be approved by the user.

This callback would be called when `https://developer.android.com/reference/kotlin/android/app/AppInteractionManager#createSession(android.app.AppInteractionSession.CreateParams,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver)` requires confirmation from the user.

Applications should launch the UI for the user to allow the creation of the session by calling `https://developer.android.com/reference/kotlin/android/content/Context.html#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20kotlin.Int,%20kotlin.Int,%20kotlin.Int)`.

| Parameters ||
|---|---|
| `executor` | [Executor](https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#): the executor to run the callback on. This value cannot be `null`. Callback and listener events are dispatched through this `https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#`, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use `https://developer.android.com/reference/kotlin/android/content/Context.html#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/kotlin/java/util/concurrent/Executor.html#` that dispatches to an appropriate thread. |
| `callback` | [Consumer](https://developer.android.com/reference/kotlin/java/util/function/Consumer.html#)\<[IntentSender](https://developer.android.com/reference/kotlin/android/content/IntentSender.html#)!\>: the callback to be called when the session request needs to be approved by the user. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#` | This value cannot be `null`. |

### setTargetPackages

Added in [API level 37.2](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun setTargetPackages(targetPackages: MutableList<String!>): AppInteractionSession.CreateParams.Builder
```

Sets the target packages for which the app interaction session will be interacting with.

| Parameters ||
|---|---|
| `targetPackages` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>: The list of target packages for which the app interaction session will be interacting with. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/AppInteractionSession.CreateParams.Builder#` | This value cannot be `null`. |