# TrustedWebActivityIntentBuilder

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/trusted/TrustedWebActivityIntentBuilder.java+class:androidx.browser.trusted.TrustedWebActivityIntentBuilder) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/browser#1.2.0)

*** ** * ** ***


```
class TrustedWebActivityIntentBuilder
```

<br />

*** ** * ** ***

Constructs instances of `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent` that can be used to start Trusted Web Activities (see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/TrustedWebUtils` for more details).

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_ADDITIONAL_TRUSTED_ORIGINS() = "android.support.customtabs.extra.ADDITIONAL_TRUSTED_ORIGINS"` Extra for the Trusted Web Activity launch Intent to specify a list of origins for the browser to treat as trusted, in addition to the origin of the launching URL. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_DISPLAY_MODE() = "androidx.browser.trusted.extra.DISPLAY_MODE"` Extra for the `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode`, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayMode(androidx.browser.trusted.TrustedWebActivityDisplayMode)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_DISPLAY_OVERRIDE() = "androidx.browser.trusted.extra.DISPLAY_OVERRIDE"` Extra for the display override list, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayOverrideList(java.util.List<androidx.browser.trusted.TrustedWebActivityDisplayMode>)` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_FILE_HANDLING_DATA() = "androidx.browser.trusted.extra.FILE_HANDLING_DATA"` Extra for the opened files data, see setHandledFiles. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_LAUNCH_HANDLER_CLIENT_MODE() = "androidx.browser.trusted.extra.LAUNCH_HANDLER_CLIENT_MODE"` If a TWA is being launched using Launch Handler API, its client mode value is provided, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setLaunchHandlerClientMode(int)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_ORIGINAL_LAUNCH_URL() = "androidx.browser.trusted.extra.ORIGINAL_LAUNCH_URL"` If the TWA is being launched using a Protocol Handler, the original URL (with the custom scheme) is provided here, set using `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setOriginalLaunchUrl(android.net.Uri)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_SCREEN_ORIENTATION() = "androidx.browser.trusted.extra.SCREEN_ORIENTATION"` Extra for the screenOrientation, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setScreenOrientation(int)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_SHARE_DATA() = "androidx.browser.trusted.extra.SHARE_DATA"` Extra for the share data, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setShareParams(androidx.browser.trusted.sharing.ShareTarget,androidx.browser.trusted.sharing.ShareData)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_SHARE_TARGET() = "androidx.browser.trusted.extra.SHARE_TARGET"` Extra for the share target, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setShareParams(androidx.browser.trusted.sharing.ShareTarget,androidx.browser.trusted.sharing.ShareData)`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#EXTRA_SPLASH_SCREEN_PARAMS() = "androidx.browser.trusted.EXTRA_SPLASH_SCREEN_PARAMS"` Extra for the Trusted Web Activity launch Intent to specify a `https://developer.android.com/reference/android/os/Bundle.html` of parameters for the browser to use in constructing a splash screen. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#TrustedWebActivityIntentBuilder(android.net.Uri)(uri: https://developer.android.com/reference/android/net/Uri.html)` Creates a Builder given the required parameters. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#build(androidx.browser.customtabs.CustomTabsSession)(session: https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsSession)` Builds an instance of `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent`. |
| `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#buildCustomTabsIntent()()` Builds a `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent` based on provided parameters. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#getDisplayMode()()` Returns `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode` set on this Builder. |
| `https://developer.android.com/reference/android/net/Uri.html` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#getUri()()` Returns the `https://developer.android.com/reference/android/net/Uri.html` to be launched with this Builder. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setAdditionalTrustedOrigins(java.util.List<java.lang.String>)(origins: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>)` Sets a list of additional trusted origins that the user may navigate or be redirected to from the starting uri. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setColorScheme(int)(colorScheme: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the color scheme, see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorScheme(int)`. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setColorSchemeParams(int,androidx.browser.customtabs.CustomTabColorSchemeParams)( colorScheme: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, params: https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams )` Sets `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams` for the given color scheme. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)(params: https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams)` Sets the default `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams`. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayMode(androidx.browser.trusted.TrustedWebActivityDisplayMode)(displayMode: https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode)` Sets a `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode`. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayOverrideList(java.util.List<androidx.browser.trusted.TrustedWebActivityDisplayMode>)( displayOverrideList: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode!>? )` Sets the display override fallback list for a Trusted Web Activity. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setFileHandlingData(androidx.browser.trusted.FileHandlingData)(fileHandlingData: https://developer.android.com/reference/kotlin/androidx/browser/trusted/FileHandlingData)` Sets the parameters for delivering launch files to the launch queue. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setLaunchHandlerClientMode(int)(launchHandlerClientMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the parameter for delivering Launch Handler API client mode via a Trusted Web Activity. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `[setNavigationBarColor](https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setNavigationBarColor(int))(color: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)` instead. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `[setNavigationBarDividerColor](https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setNavigationBarDividerColor(int))(color: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)` instead. <br /> |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setOriginalLaunchUrl(android.net.Uri)(originalLaunchUrl: https://developer.android.com/reference/android/net/Uri.html)` Sets the original launch URL. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setScreenOrientation(int)(orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets a screenOrientation. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setShareParams(androidx.browser.trusted.sharing.ShareTarget,androidx.browser.trusted.sharing.ShareData)(shareTarget: https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget, shareData: https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData)` Sets the parameters for delivering data to a Web Share Target via a Trusted Web Activity. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setSplashScreenParams(android.os.Bundle)(splashScreenParams: https://developer.android.com/reference/android/os/Bundle.html)` Sets the parameters of a splash screen shown while the web page is loading, such as background color. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` | `[setToolbarColor](https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setToolbarColor(int))(color: @https://developer.android.com/reference/kotlin/androidx/annotation/ColorInt https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` **This function is deprecated.** Use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)` instead. <br /> |

## Constants

### EXTRA_ADDITIONAL_TRUSTED_ORIGINS

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

```
const val EXTRA_ADDITIONAL_TRUSTED_ORIGINS = "android.support.customtabs.extra.ADDITIONAL_TRUSTED_ORIGINS": String!
```

Extra for the Trusted Web Activity launch Intent to specify a list of origins for the browser to treat as trusted, in addition to the origin of the launching URL. It is recommended to use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` instead of manually piecing the Intent together.

### EXTRA_DISPLAY_MODE

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

```
const val EXTRA_DISPLAY_MODE = "androidx.browser.trusted.extra.DISPLAY_MODE": String!
```

Extra for the `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode`, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayMode(androidx.browser.trusted.TrustedWebActivityDisplayMode)`.

### EXTRA_DISPLAY_OVERRIDE

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

```
const val EXTRA_DISPLAY_OVERRIDE = "androidx.browser.trusted.extra.DISPLAY_OVERRIDE": String!
```

Extra for the display override list, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayOverrideList(java.util.List<androidx.browser.trusted.TrustedWebActivityDisplayMode>)`

### EXTRA_FILE_HANDLING_DATA

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

```
const val EXTRA_FILE_HANDLING_DATA = "androidx.browser.trusted.extra.FILE_HANDLING_DATA": String!
```

Extra for the opened files data, see setHandledFiles.

### EXTRA_LAUNCH_HANDLER_CLIENT_MODE

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

```
const val EXTRA_LAUNCH_HANDLER_CLIENT_MODE = "androidx.browser.trusted.extra.LAUNCH_HANDLER_CLIENT_MODE": String!
```

If a TWA is being launched using Launch Handler API, its client mode value is provided, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setLaunchHandlerClientMode(int)`.

### EXTRA_ORIGINAL_LAUNCH_URL

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

```
const val EXTRA_ORIGINAL_LAUNCH_URL = "androidx.browser.trusted.extra.ORIGINAL_LAUNCH_URL": String!
```

If the TWA is being launched using a Protocol Handler, the original URL (with the custom scheme) is provided here, set using `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setOriginalLaunchUrl(android.net.Uri)`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getOriginalLaunchUrl()` |   |

### EXTRA_SCREEN_ORIENTATION

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

```
const val EXTRA_SCREEN_ORIENTATION = "androidx.browser.trusted.extra.SCREEN_ORIENTATION": String!
```

Extra for the screenOrientation, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setScreenOrientation(int)`.

### EXTRA_SHARE_DATA

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

```
const val EXTRA_SHARE_DATA = "androidx.browser.trusted.extra.SHARE_DATA": String!
```

Extra for the share data, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setShareParams(androidx.browser.trusted.sharing.ShareTarget,androidx.browser.trusted.sharing.ShareData)`.

### EXTRA_SHARE_TARGET

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

```
const val EXTRA_SHARE_TARGET = "androidx.browser.trusted.extra.SHARE_TARGET": String!
```

Extra for the share target, see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setShareParams(androidx.browser.trusted.sharing.ShareTarget,androidx.browser.trusted.sharing.ShareData)`.

### EXTRA_SPLASH_SCREEN_PARAMS

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

```
const val EXTRA_SPLASH_SCREEN_PARAMS = "androidx.browser.trusted.EXTRA_SPLASH_SCREEN_PARAMS": String!
```

Extra for the Trusted Web Activity launch Intent to specify a `https://developer.android.com/reference/android/os/Bundle.html` of parameters for the browser to use in constructing a splash screen. It is recommended to use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder` instead of manually piecing the Intent together.

## Public constructors

### TrustedWebActivityIntentBuilder

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

```
TrustedWebActivityIntentBuilder(uri: Uri)
```

Creates a Builder given the required parameters.

| Parameters |
|---|---|
| `uri: https://developer.android.com/reference/android/net/Uri.html` | The web page to launch as Trusted Web Activity. |

## Public functions

### build

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

```
fun build(session: CustomTabsSession): TrustedWebActivityIntent
```

Builds an instance of `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent`.

| Parameters |
|---|---|
| `session: https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsSession` | The `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsSession` to use for launching a Trusted Web Activity. |

### buildCustomTabsIntent

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

```
fun buildCustomTabsIntent(): CustomTabsIntent
```

Builds a `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent` based on provided parameters. Can be useful for falling back to Custom Tabs when Trusted Web Activity providers are unavailable.

### getDisplayMode

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

```
fun getDisplayMode(): TrustedWebActivityDisplayMode
```

Returns `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode` set on this Builder.

### getUri

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

```
fun getUri(): Uri
```

Returns the `https://developer.android.com/reference/android/net/Uri.html` to be launched with this Builder.

### setAdditionalTrustedOrigins

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

```
fun setAdditionalTrustedOrigins(origins: (Mutable)List<String!>): TrustedWebActivityIntentBuilder
```

Sets a list of additional trusted origins that the user may navigate or be redirected to from the starting uri. For example, if the user starts at https://www.example.com/page1 and is redirected to https://m.example.com/page2, and both origins are associated with the calling application via the Digital Asset Links, then pass "https://www.example.com/page1" as uri and Arrays.asList("https://m.example.com") as additionalTrustedOrigins. Alternatively, use `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsSession#validateRelationship(int,android.net.Uri,android.os.Bundle)` to validate additional origins asynchronously, but that would delay launching the Trusted Web Activity.

### setColorScheme

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

```
fun setColorScheme(colorScheme: Int): TrustedWebActivityIntentBuilder
```

Sets the color scheme, see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorScheme(int)`. In Trusted Web Activities color scheme may affect such UI elements as info bars and context menus.

| Parameters |
|---|---|
| `colorScheme: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Must be one of `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent#COLOR_SCHEME_SYSTEM()`, `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent#COLOR_SCHEME_LIGHT()`, and `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent#COLOR_SCHEME_DARK()`. |

### setColorSchemeParams

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

```
fun setColorSchemeParams(
    colorScheme: Int,
    params: CustomTabColorSchemeParams
): TrustedWebActivityIntentBuilder
```

Sets `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams` for the given color scheme. This allows, for example, to set two navigation bar colors - for light and dark scheme. Trusted Web Activity will automatically apply the correct color according to current system settings. For more details see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#setColorSchemeParams(int,androidx.browser.customtabs.CustomTabColorSchemeParams)`.

### setDefaultColorSchemeParams

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

```
fun setDefaultColorSchemeParams(params: CustomTabColorSchemeParams): TrustedWebActivityIntentBuilder
```

Sets the default `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams`. This will set a default color scheme that applies when no CustomTabColorSchemeParams specified for current color scheme via `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setColorSchemeParams(int,androidx.browser.customtabs.CustomTabColorSchemeParams)`.

| Parameters |
|---|---|
| `params: https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams` | An instance of `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabColorSchemeParams`. |

### setDisplayMode

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

```
fun setDisplayMode(displayMode: TrustedWebActivityDisplayMode): TrustedWebActivityIntentBuilder
```

Sets a `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode`. This can be used e.g. to enable immersive mode (see `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode.ImmersiveMode`. Not setting it means `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode.DefaultMode` will be used.

### setDisplayOverrideList

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

```
fun setDisplayOverrideList(
    displayOverrideList: (Mutable)List<TrustedWebActivityDisplayMode!>?
): TrustedWebActivityIntentBuilder
```

Sets the display override fallback list for a Trusted Web Activity. Web applications can declare a "display_override" list to specify the preferred order of display modes. This is useful for more advanced display modes that may have limited browser support ({@see https://wicg.github.io/manifest-incubations/#display_override-member}). The browser will use the first display mode in the list that it supports, and fall back to the \`display\` manifest field if none are supported.

| Parameters |
|---|---|
| `displayOverrideList: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode!>?` | A list of `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityDisplayMode` that represents the fallback order of display modes. |

### setFileHandlingData

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

```
fun setFileHandlingData(fileHandlingData: FileHandlingData): TrustedWebActivityIntentBuilder
```

Sets the parameters for delivering launch files to the launch queue. A web application can declare "file_handlers" in its web manifest, enabling it to handle file opening requests from users. The opened files are then made available by the browser to the web app through the LaunchQueue interface of the Launch Handler API. LaunchQueue implementation depends on a browser receiving a TrustedWebActivityIntent. This method provides the support for file handling in Trusted Web Activities. `https://developer.android.com/reference/kotlin/androidx/browser/trusted/FileHandlingData` should contain the URIs list of files opened by a user and captured by an intent filter declared in the app manifest. API doesn't perform URI validation and it entirely dependents on a browser receiving a TrustedWebActivityIntent. The API passes read/write permissions for the files to the browser to allow the web application to read and write a file as it required by LaunchQueue interface specification.

| Parameters |
|---|---|
| `fileHandlingData: https://developer.android.com/reference/kotlin/androidx/browser/trusted/FileHandlingData` | A `https://developer.android.com/reference/kotlin/androidx/browser/trusted/FileHandlingData` object containing the data to be sent to browser launch queue. |

### setLaunchHandlerClientMode

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

```
fun setLaunchHandlerClientMode(launchHandlerClientMode: Int): TrustedWebActivityIntentBuilder
```

Sets the parameter for delivering Launch Handler API client mode via a Trusted Web Activity.

| Parameters |
|---|---|
| `launchHandlerClientMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A string describing the client mode. |

### setNavigationBarColor

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

```
fun [setNavigationBarColor](https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setNavigationBarColor(int))(color: @ColorInt Int): TrustedWebActivityIntentBuilder
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)` instead.

Sets the navigation bar color, see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#setNavigationBarColor(int)`.

### setNavigationBarDividerColor

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/browser#1.3.0) Deprecated in [1.3.0](https://developer.android.com/jetpack/androidx/releases/browser#1.3.0)

```
fun [setNavigationBarDividerColor](https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setNavigationBarDividerColor(int))(color: @ColorInt Int): TrustedWebActivityIntentBuilder
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)` instead.

Sets the navigation bar divider color, see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#setNavigationBarDividerColor(int)`.

### setOriginalLaunchUrl

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

```
fun setOriginalLaunchUrl(originalLaunchUrl: Uri): TrustedWebActivityIntentBuilder
```

Sets the original launch URL. This is used by Protocol Handlers to let the browser see the URL that was opened before being processed an modified (the original URL will usually have a custom data scheme and no host, as opposed to the full http/https location in the Intent data).

| Parameters |
|---|---|
| `originalLaunchUrl: https://developer.android.com/reference/android/net/Uri.html` | The URL that was originally opened, before being processed and modified by a Protocol Handler. |

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getOriginalLaunchUrl()` |   |

### setScreenOrientation

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

```
fun setScreenOrientation(orientation: Int): TrustedWebActivityIntentBuilder
```

Sets a screenOrientation. This can be used e.g. to enable the locking of an orientation lock type `https://developer.android.com/reference/kotlin/androidx/browser/trusted/ScreenOrientation`.

| Parameters |
|---|---|
| `orientation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A `https://developer.android.com/reference/kotlin/androidx/browser/trusted/ScreenOrientation` lock type for a Trusted Web Activity. Not setting it means `https://developer.android.com/reference/kotlin/androidx/browser/trusted/ScreenOrientation#DEFAULT()` will be used. |

### setShareParams

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

```
fun setShareParams(shareTarget: ShareTarget, shareData: ShareData): TrustedWebActivityIntentBuilder
```

Sets the parameters for delivering data to a Web Share Target via a Trusted Web Activity.

| Parameters |
|---|---|
| `shareTarget: https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget` | A `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareTarget` object describing the Web Share Target. |
| `shareData: https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData` | A `https://developer.android.com/reference/kotlin/androidx/browser/trusted/sharing/ShareData` object containing the data to be sent to the Web Share Target. |

### setSplashScreenParams

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

```
fun setSplashScreenParams(splashScreenParams: Bundle): TrustedWebActivityIntentBuilder
```

Sets the parameters of a splash screen shown while the web page is loading, such as background color. See `https://developer.android.com/reference/kotlin/androidx/browser/trusted/splashscreens/SplashScreenParamKey` for a list of supported parameters. To provide the image for the splash screen, use `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/TrustedWebUtils#transferSplashImage(android.content.Context,java.io.File,java.lang.String,java.lang.String,androidx.browser.customtabs.CustomTabsSession)`, prior to launching the intent. It is recommended to also show the same splash screen in the app as soon as possible, prior to establishing a CustomTabConnection. The Trusted Web Activity provider should ensure seamless transition of the splash screen from the app onto the top of webpage being loaded. The splash screen will be removed on the first paint of the page, or when the page load fails.

### setToolbarColor

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

```
fun [setToolbarColor](https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setToolbarColor(int))(color: @ColorInt Int): TrustedWebActivityIntentBuilder
```

> [!CAUTION]
> **This function is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDefaultColorSchemeParams(androidx.browser.customtabs.CustomTabColorSchemeParams)` instead.

Sets the color applied to the toolbar and the status bar, see `https://developer.android.com/reference/kotlin/androidx/browser/customtabs/CustomTabsIntent.Builder#setToolbarColor(int)`. When a Trusted Web Activity is on the verified origin, the toolbar is hidden, so the color applies only to the status bar. When it's on an unverified origin, the toolbar is shown, and the color applies to both toolbar and status bar.