Added in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/app/assist/AssistContent#constants) \| [Inherited Constants](https://developer.android.com/reference/android/app/assist/AssistContent#inhconstants) \| [Fields](https://developer.android.com/reference/android/app/assist/AssistContent#lfields) \| [Ctors](https://developer.android.com/reference/android/app/assist/AssistContent#pubctors) \| [Methods](https://developer.android.com/reference/android/app/assist/AssistContent#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/assist/AssistContent#inhmethods)

# AssistContent

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/app/assist/AssistContent "View this page in Kotlin") \|Java


`
public


class
AssistContent
`


`

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


`

`


implements

https://developer.android.com/reference/android/os/Parcelable


`

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

<br />

*** ** * ** ***

Holds information about the content an application is viewing, to hand to an
assistant at the user's request. This is filled in by
`https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)`.

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/assist/AssistContent#EXTRA_APP_FUNCTION_DATA` Extra for a `https://developer.android.com/reference/android/os/Bundle` that provides contextual AppFunction's information about the content currently being viewed in the application. |

| ### Inherited constants |
|---|
| From interface `https://developer.android.com/reference/android/os/Parcelable` |---|---| | `int` | `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor. | | `int` | `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". | |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/app/assist/AssistContent>` | `https://developer.android.com/reference/android/app/assist/AssistContent#CREATOR` |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/assist/AssistContent#AssistContent()() ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/assist/AssistContent#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/android/content/ClipData` | ` https://developer.android.com/reference/android/app/assist/AssistContent#getClipData()() ` Return the current `https://developer.android.com/reference/android/app/assist/AssistContent#setClipData(android.content.ClipData)`, which you can modify in-place. |
| ` https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/app/assist/AssistContent#getExtras()() ` Return Bundle for extra vendor-specific data that can be modified and examined. |
| ` https://developer.android.com/reference/android/content/Intent` | ` https://developer.android.com/reference/android/app/assist/AssistContent#getIntent()() ` Returns the current `https://developer.android.com/reference/android/app/assist/AssistContent#setIntent(android.content.Intent)` if one is set, else the default Intent obtained from `https://developer.android.com/reference/android/app/Activity#getIntent()`. |
| ` https://developer.android.com/reference/android/net/Uri` | ` https://developer.android.com/reference/android/app/assist/AssistContent#getSessionTransferUri()() ` Return the content's session transfer web URI as per `https://developer.android.com/reference/android/app/assist/AssistContent#setSessionTransferUri(android.net.Uri)`, or null if there is none. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/assist/AssistContent#getStructuredData()() ` Returns the current `https://developer.android.com/reference/android/app/assist/AssistContent#setStructuredData(java.lang.String)`. |
| ` https://developer.android.com/reference/android/net/Uri` | ` https://developer.android.com/reference/android/app/assist/AssistContent#getWebUri()() ` Return the content's web URI as per `https://developer.android.com/reference/android/app/assist/AssistContent#setWebUri(android.net.Uri)`, or null if there is none. |
| ` boolean` | ` https://developer.android.com/reference/android/app/assist/AssistContent#isAppProvidedIntent()() ` Returns whether or not the current Intent was explicitly provided in `https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)`. |
| ` boolean` | ` https://developer.android.com/reference/android/app/assist/AssistContent#isAppProvidedWebUri()() ` Returns whether or not the current `https://developer.android.com/reference/android/app/assist/AssistContent#getWebUri()` was explicitly provided in `https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)`. |
| ` void` | ` https://developer.android.com/reference/android/app/assist/AssistContent#setClipData(android.content.ClipData)(https://developer.android.com/reference/android/content/ClipData clip) ` Optional additional content items that are involved with the current UI. |
| ` void` | ` https://developer.android.com/reference/android/app/assist/AssistContent#setIntent(android.content.Intent)(https://developer.android.com/reference/android/content/Intent intent) ` Sets the Intent associated with the content, describing the current top-level context of the activity. |
| ` void` | ` https://developer.android.com/reference/android/app/assist/AssistContent#setSessionTransferUri(android.net.Uri)(https://developer.android.com/reference/android/net/Uri uri) ` This method can be used to provide a `https://developer.android.com/reference/android/net/Uri` which will be utilized when transitioning a user's session to another surface. |
| ` void` | ` https://developer.android.com/reference/android/app/assist/AssistContent#setStructuredData(java.lang.String)(https://developer.android.com/reference/java/lang/String structuredData) ` Sets optional structured data regarding the content being viewed. |
| ` void` | ` https://developer.android.com/reference/android/app/assist/AssistContent#setWebUri(android.net.Uri)(https://developer.android.com/reference/android/net/Uri uri) ` Set a web URI associated with the current data being shown to the user. |
| ` void` | ` https://developer.android.com/reference/android/app/assist/AssistContent#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

| ### 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*. | ||
| From interface ` https://developer.android.com/reference/android/os/Parcelable ` |---|---| | ` abstract int` | ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. | | ` abstract void` | ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### EXTRA_APP_FUNCTION_DATA

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

```
public static final String EXTRA_APP_FUNCTION_DATA
```

Extra for a `https://developer.android.com/reference/android/os/Bundle` that provides contextual AppFunction's information about the
content currently being viewed in the application.


This extra can be optionally supplied in the `https://developer.android.com/reference/android/app/assist/AssistContent#getExtras()` bundle.


The schema of the `https://developer.android.com/reference/android/os/Bundle` in this extra is defined in the AppFunction SDK.

<br />

**See also:**

- `https://developer.android.com/reference/android/app/appfunctions/AppFunctionManager`

Constant Value:

"android.app.assist.extra.APP_FUNCTION_DATA"


## Fields

### CREATOR

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

```
public static final Creator<AssistContent> CREATOR
```

<br />

<br />

## Public constructors

### AssistContent

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

```
public AssistContent ()
```

<br />

<br />

## Public methods

### describeContents

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

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`,
the return value of this method must include the
`https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getClipData

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

```
public ClipData getClipData ()
```

Return the current `https://developer.android.com/reference/android/app/assist/AssistContent#setClipData(android.content.ClipData)`, which you can modify in-place.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/ClipData` | <br /> |

### getExtras

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

```
public Bundle getExtras ()
```

Return Bundle for extra vendor-specific data that can be modified and examined.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | <br /> |

### getIntent

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

```
public Intent getIntent ()
```

Returns the current `https://developer.android.com/reference/android/app/assist/AssistContent#setIntent(android.content.Intent)` if one is set, else the default Intent obtained from
`https://developer.android.com/reference/android/app/Activity#getIntent()`. Can be modified in-place.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/content/Intent` | <br /> |

### getSessionTransferUri

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

```
public Uri getSessionTransferUri ()
```

Return the content's session transfer web URI as per
`https://developer.android.com/reference/android/app/assist/AssistContent#setSessionTransferUri(android.net.Uri)`, or null if there is none.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/Uri` | <br /> |

### getStructuredData

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

```
public String getStructuredData ()
```

Returns the current `https://developer.android.com/reference/android/app/assist/AssistContent#setStructuredData(java.lang.String)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getWebUri

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

```
public Uri getWebUri ()
```

Return the content's web URI as per `https://developer.android.com/reference/android/app/assist/AssistContent#setWebUri(android.net.Uri)`, or null if
there is none.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/net/Uri` | <br /> |

### isAppProvidedIntent

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

```
public boolean isAppProvidedIntent ()
```

Returns whether or not the current Intent was explicitly provided in
`https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)`. If not,
the Intent was automatically set based on
`https://developer.android.com/reference/android/app/Activity#getIntent()`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### isAppProvidedWebUri

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

```
public boolean isAppProvidedWebUri ()
```

Returns whether or not the current `https://developer.android.com/reference/android/app/assist/AssistContent#getWebUri()` was explicitly provided in
`https://developer.android.com/reference/android/app/Activity#onProvideAssistContent(android.app.assist.AssistContent)`. If not,
the Intent was automatically set based on
`https://developer.android.com/reference/android/app/Activity#getIntent()`.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### setClipData

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

```
public void setClipData (ClipData clip)
```

Optional additional content items that are involved with
the current UI. Access to this content will be granted to the assistant as if you
are sending it through an Intent with `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION`.

<br />

| Parameters ||
|---|---|
| `clip` | `ClipData` <br /> |

### setIntent

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

```
public void setIntent (Intent intent)
```

Sets the Intent associated with the content, describing the current top-level context of
the activity. If this contains a reference to a piece of data related to the activity,
be sure to set `https://developer.android.com/reference/android/content/Intent#FLAG_GRANT_READ_URI_PERMISSION` so the accessibility
service can access it.

<br />

| Parameters ||
|---|---|
| `intent` | `Intent` <br /> |

### setSessionTransferUri

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

```
public void setSessionTransferUri (Uri uri)
```

This method can be used to provide a `https://developer.android.com/reference/android/net/Uri` which will be utilized when transitioning a
user's session to another surface.

If provided, instead of using the URI provided in `https://developer.android.com/reference/android/app/assist/AssistContent#setWebUri(android.net.Uri)`, the
"Open in browser" feature will use this URI to transition the current session from one
surface to the other. Apps may choose to encode session or user information into this
URI in order to provide a better session transfer experience. However, while this URI will
only be available to the system and not other applications, developers should not encode
authentication credentials into this URI, because it will be surfaced in the browser URL bar
and may be copied and shared from there.

When providing this URI, developers should still continue to provide
`https://developer.android.com/reference/android/app/assist/AssistContent#setWebUri(android.net.Uri)` for backwards compatibility with features such as
[recents URL sharing](https://developer.android.com/guide/components/activities/recents#url-sharing) which facilitate link sharing with other users and would not benefit
from a session-transfer URI.

<br />

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

**See also:**

- `https://developer.android.com/reference/android/app/Activity#requestOpenInBrowserEducation()`

### setStructuredData

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

```
public void setStructuredData (String structuredData)
```

Sets optional structured data regarding the content being viewed. The provided data
must be a string represented with [JSON-LD](http://json-ld.org/) using the
[schema.org](http://schema.org/) vocabulary.

<br />

| Parameters ||
|---|---|
| `structuredData` | `String` <br /> |

### setWebUri

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

```
public void setWebUri (Uri uri)
```

Set a web URI associated with the current data being shown to the user.
This URI could be opened in a web browser, or in the app as an
`https://developer.android.com/reference/android/content/Intent#ACTION_VIEW` Intent, to show the same data that is currently
being displayed by it. The URI here should be something that is transportable
off the device into other environments to acesss the same data as is currently
being shown in the app; if the app does not have such a representation, it should
leave the null and only report the local intent and clip data.

<br />

| Parameters ||
|---|---|
| `uri` | `Uri` <br /> |

### writeToParcel

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

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |