# TrustedWebActivityIntent

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

*** ** * ** ***


```
class TrustedWebActivityIntent
```

<br />

*** ** * ** ***

Holds an `https://developer.android.com/reference/android/content/Intent.html` and other data necessary to start a Trusted Web Activity.

## Summary

| ### Public functions |
|---|---|
| `(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!>` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getDisplayOverrideList()()` Used by the web app manifest to specify the fallback order for display modes. |
| `https://developer.android.com/reference/kotlin/androidx/browser/trusted/FileHandlingData?` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getFileHandlingData()()` |
| `https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getIntent()()` Returns the held `https://developer.android.com/reference/android/content/Intent.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getLaunchHandlerClientMode()()` Used for Launch Handler API to provide client mode to a browser. |
| `https://developer.android.com/reference/android/net/Uri.html?` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#getOriginalLaunchUrl()()` Used by Protocol Handlers to provide context for the browser. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#launchTrustedWebActivity(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` Launches a Trusted Web Activity. |

## Public functions

### getDisplayOverrideList

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

```
fun getDisplayOverrideList(): (Mutable)List<TrustedWebActivityDisplayMode!>
```

Used by the web app manifest to specify the fallback order for display modes. This can be changed using `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntentBuilder#setDisplayOverrideList(java.util.List<androidx.browser.trusted.TrustedWebActivityDisplayMode>)`.

| Returns |
|---|---|
| `(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. |

### getFileHandlingData

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

```
fun getFileHandlingData(): FileHandlingData?
```

### getIntent

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

```
fun getIntent(): Intent
```

Returns the held `https://developer.android.com/reference/android/content/Intent.html`. For launching a Trusted Web Activity prefer using `https://developer.android.com/reference/kotlin/androidx/browser/trusted/TrustedWebActivityIntent#launchTrustedWebActivity(android.content.Context)`.

### getLaunchHandlerClientMode

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

```
fun getLaunchHandlerClientMode(): Int
```

Used for Launch Handler API to provide client mode to a browser. {@see https://developer.mozilla.org/en-US/docs/Web/API/Launch_Handler_API}

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | An integer that represents Launch Handler API client mode. |

### getOriginalLaunchUrl

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

```
fun getOriginalLaunchUrl(): Uri?
```

Used by Protocol Handlers to provide context for the browser. When a custom data scheme link (e.g. web+coffee://latte) is being processed by a WebAPK/TWA, it will get replaced with an actual http/https location (e.g. https://coffee.com/?type=latte) and that URL gets sent to the browser. This extra will then store the original link in case the browser needs different logic for Protocol Handlers and regular links. {@see https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Manifest/Reference/protocol_handlers}

| Returns |
|---|---|
| `https://developer.android.com/reference/android/net/Uri.html?` | The original URL before being processed by a Protocol Handler, or null if this was never a custom data scheme link. |

### launchTrustedWebActivity

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

```
fun launchTrustedWebActivity(context: Context): Unit
```

Launches a Trusted Web Activity.