# TrustedWebUtils

added in[version 27.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:customtabs:28.0.0-alpha1  
Summary:[Constants](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#constants)\|[Methods](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#)  

# TrustedWebUtils

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


class
TrustedWebUtils
`  
`

extends Object


``


`

|---|--------------------------------------------|
| java.lang.Object                              ||
| ↳ | android.support.customtabs.TrustedWebUtils |

<br />

*** ** * ** ***

Class for utilities and convenience calls for opening a qualifying web page as a Trusted Web Activity. Trusted Web Activity is a fullscreen UI with no visible browser controls that hosts web pages meeting certain criteria. The full list of qualifications is at the implementing browser's discretion, but minimum recommended set is for the web page :

- To have declared delegate_permission/common.handle_all_urls relationship with the launching client application ensuring 1:1 trust between the Android native and web components. See https://developers.google.com/digital-asset-links/ for details.
- To work as a reliable, fast and engaging standalone component within the launching app's flow.
- To be accessible and operable even when offline.

Fallback behaviors may also differ with implementation. Possibilities are launching the page in a custom tab, or showing it in browser UI. Browsers are encouraged to use[onRelationshipValidationResult(int, Uri, boolean, Bundle)](https://developer.android.com/reference/android/support/customtabs/CustomTabsCallback#onRelationshipValidationResult(int, android.net.Uri, boolean, android.os.Bundle))for sending details of the verification results.

<br />

## Summary

|                                                                                                                                                                              ### Constants                                                                                                                                                                              ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `String` | [EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY) Boolean extra that triggers a[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)launch to be in a fullscreen UI with no browser controls. |

|                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                              ||
|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static void` | ` `[launchAsTrustedWebActivity](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#launchAsTrustedWebActivity(android.content.Context, android.support.customtabs.CustomTabsIntent, android.net.Uri))`(`[Context](https://developer.android.com/reference/android/content/Context.html)` context, `[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)` customTabsIntent, `[Uri](https://developer.android.com/reference/android/net/Uri.html)` uri) ` Launch the given[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)as a Trusted Web Activity. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY

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

```
String EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY
```

Boolean extra that triggers a[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)launch to be in a fullscreen UI with no browser controls.

<br />

**See also:**

- [launchAsTrustedWebActivity(Context, CustomTabsIntent, Uri)](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils#launchAsTrustedWebActivity(android.content.Context, android.support.customtabs.CustomTabsIntent, android.net.Uri))

Constant Value: "android.support.customtabs.extra.LAUNCH_AS_TRUSTED_WEB_ACTIVITY"

## Public methods

### launchAsTrustedWebActivity

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

```
void launchAsTrustedWebActivity (Context context, 
                CustomTabsIntent customTabsIntent, 
                Uri uri)
```

Launch the given[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)as a Trusted Web Activity. The given[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)should have a valid[CustomTabsSession](https://developer.android.com/reference/android/support/customtabs/CustomTabsSession)associated with it during construction. Once the Trusted Web Activity is launched, browser side implementations may have their own fallback behavior (e.g. Showing the page in a custom tab UI with toolbar) based on qualifications listed above or more.

<br />

|                                                                                                                                                 Parameters                                                                                                                                                  ||
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `context`          | `Context`:[Context](https://developer.android.com/reference/android/content/Context.html)to use while launching the[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent). <br />                                                      |
| `customTabsIntent` | `CustomTabsIntent`: The[CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)to use for launching the Trusted Web Activity. Note that all customizations in the given associated with browser toolbar controls will be ignored. <br /> |
| `uri`              | `Uri`: The web page to launch as Trusted Web Activity. <br />                                                                                                                                                                                                                           |

-

  ## Annotations

  - [CustomTabsService.Relation](https://developer.android.com/reference/android/support/customtabs/CustomTabsService.Relation)
  - [CustomTabsService.Result](https://developer.android.com/reference/android/support/customtabs/CustomTabsService.Result)
-

  ## Classes

  - [CustomTabsCallback](https://developer.android.com/reference/android/support/customtabs/CustomTabsCallback)
  - [CustomTabsClient](https://developer.android.com/reference/android/support/customtabs/CustomTabsClient)
  - [CustomTabsIntent](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent)
  - [CustomTabsIntent.Builder](https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.Builder)
  - [CustomTabsService](https://developer.android.com/reference/android/support/customtabs/CustomTabsService)
  - [CustomTabsServiceConnection](https://developer.android.com/reference/android/support/customtabs/CustomTabsServiceConnection)
  - [CustomTabsSession](https://developer.android.com/reference/android/support/customtabs/CustomTabsSession)
  - [CustomTabsSessionToken](https://developer.android.com/reference/android/support/customtabs/CustomTabsSessionToken)
  - [PostMessageService](https://developer.android.com/reference/android/support/customtabs/PostMessageService)
  - [PostMessageServiceConnection](https://developer.android.com/reference/android/support/customtabs/PostMessageServiceConnection)
  - [R](https://developer.android.com/reference/android/support/customtabs/R)
  - [R.anim](https://developer.android.com/reference/android/support/customtabs/R.anim)
  - [R.attr](https://developer.android.com/reference/android/support/customtabs/R.attr)
  - [R.bool](https://developer.android.com/reference/android/support/customtabs/R.bool)
  - [R.color](https://developer.android.com/reference/android/support/customtabs/R.color)
  - [R.dimen](https://developer.android.com/reference/android/support/customtabs/R.dimen)
  - [R.drawable](https://developer.android.com/reference/android/support/customtabs/R.drawable)
  - [R.id](https://developer.android.com/reference/android/support/customtabs/R.id)
  - [R.integer](https://developer.android.com/reference/android/support/customtabs/R.integer)
  - [R.layout](https://developer.android.com/reference/android/support/customtabs/R.layout)
  - [R.string](https://developer.android.com/reference/android/support/customtabs/R.string)
  - [R.style](https://developer.android.com/reference/android/support/customtabs/R.style)
  - [R.styleable](https://developer.android.com/reference/android/support/customtabs/R.styleable)
  - [TrustedWebUtils](https://developer.android.com/reference/android/support/customtabs/TrustedWebUtils)