Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions) Summary: [Ctors](https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#inhmethods)

# AppInteractionSession.CreateParams.Builder

*** ** * ** ***


`
public
static
final

class
AppInteractionSession.CreateParams.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.AppInteractionSession.CreateParams.Builder |

<br />

*** ** * ** ***

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

## Summary

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

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams` | ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#build()() ` Builds the `https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams`. |
| ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder` | ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#setExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Sets the additional metadata for this session. |
| ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder` | ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#setOnStartIntentSenderCallback(java.util.concurrent.Executor,%20java.util.function.Consumer<android.content.IntentSender>)(https://developer.android.com/reference/java/util/concurrent/Executor executor, https://developer.android.com/reference/java/util/function/Consumer<https://developer.android.com/reference/android/content/IntentSender> callback) ` Called when the session creation needs to be approved by the user. |
| ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder` | ` https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder#setTargetPackages(java.util.List<java.lang.String>)(https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String> targetPackages) ` Sets the target packages for which the app interaction session will be interacting with. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Public constructors

### Builder

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public Builder ()
```

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

<br />

## Public methods

### build

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public AppInteractionSession.CreateParams build ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams` | This value cannot be `null`. <br /> |

### setExtras

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public AppInteractionSession.CreateParams.Builder setExtras (Bundle extras)
```

Sets the additional metadata for this session.

<br />

| Parameters ||
|---|---|
| `extras` | `Bundle`: The additional metadata for this session. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder` | This value cannot be `null`. <br /> |

### setOnStartIntentSenderCallback

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

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

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

This callback would be called when `https://developer.android.com/reference/android/app/AppInteractionManager#createSession(android.app.AppInteractionSession.CreateParams,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<android.app.AppInteractionSession,android.app.AppInteractionException>)`
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/android/content/Context#startIntentSender(android.content.IntentSender,%20android.content.Intent,%20int,%20int,%20int)`.

<br />

| Parameters ||
|---|---|
| `executor` | `Executor`: 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/java/util/concurrent/Executor`, 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/android/content/Context#getMainExecutor()`. Otherwise, provide an `https://developer.android.com/reference/java/util/concurrent/Executor` that dispatches to an appropriate thread. <br /> |
| `callback` | `Consumer`: the callback to be called when the session request needs to be approved by the user. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder` | This value cannot be `null`. <br /> |

### setTargetPackages

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public AppInteractionSession.CreateParams.Builder setTargetPackages (List<String> targetPackages)
```

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

<br />

| Parameters ||
|---|---|
| `targetPackages` | `List`: The list of target packages for which the app interaction session will be interacting with. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/AppInteractionSession.CreateParams.Builder` | This value cannot be `null`. <br /> |