Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#inhmethods)

# AppInteractionAttribution.Builder

*** ** * ** ***


`
public
static
final

class
AppInteractionAttribution.Builder
`


`

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


`

`


`

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

<br />

*** ** * ** ***

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

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#Builder(int)(int interactionType) ` Creates a new instance of this builder class. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/AppInteractionAttribution` | ` https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#build()() ` Builds the `https://developer.android.com/reference/android/app/AppInteractionAttribution`. |
| ` https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder` | ` https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#setCustomInteractionType(java.lang.String)(https://developer.android.com/reference/java/lang/String customInteractionType) ` Sets the custom interaction type to describe the interaction. |
| ` https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder` | ` https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#setInteractionUri(android.net.Uri)(https://developer.android.com/reference/android/net/Uri interactionUri) ` Sets a deeplink `https://developer.android.com/reference/android/net/Uri` to the user request that initiated the interaction. |

| ### 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 [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (int interactionType)
```

Creates a new instance of this builder class.

<br />

| Parameters ||
|---|---|
| `interactionType` | `int`: The interaction type. Must be one of `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_OTHER`, `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_USER_QUERY`, or `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_USER_SCHEDULED`. If `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_OTHER` is used, `https://developer.android.com/reference/android/app/AppInteractionAttribution.Builder#setCustomInteractionType(java.lang.String)` must also be called. Value is one of the following: - `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_OTHER` - `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_USER_QUERY` - `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_USER_SCHEDULED` |

## Public methods

### build

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

```
public AppInteractionAttribution build ()
```

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

<br />

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

### setCustomInteractionType

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

```
public AppInteractionAttribution.Builder setCustomInteractionType (String customInteractionType)
```

Sets the custom interaction type to describe the interaction.

This method must be called if and only if the `interactionType` provided to the
constructor was `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_OTHER`. The caller
should define a set of string constants for these custom interaction types and set them
here accordingly.

<br />

| Parameters ||
|---|---|
| `customInteractionType` | `String`: This value cannot be `null`. <br /> |

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

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If the interaction type is not `https://developer.android.com/reference/android/app/AppInteractionAttribution#INTERACTION_TYPE_OTHER`. |

### setInteractionUri

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

```
public AppInteractionAttribution.Builder setInteractionUri (Uri interactionUri)
```

Sets a deeplink `https://developer.android.com/reference/android/net/Uri` to the user request that initiated the interaction.

When set, this URI can be used by privacy settings to display a link in the audit
history, allowing users to navigate to the context of the original interaction.

For the link to be functional, the provided `https://developer.android.com/reference/android/net/Uri` **must** be
resolvable by an `https://developer.android.com/reference/android/content/Intent` with the action `https://developer.android.com/reference/android/content/Intent#ACTION_VIEW`. To allow privacy settings to launch your activity,
the target `https://developer.android.com/reference/android/app/Activity` **must** declare a corresponding
`<intent-filter>` in your manifest.

<br />

| Parameters ||
|---|---|
| `interactionUri` | `Uri`: This value may be `null`. <br /> |

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