Android APIs
public class

AssistContent

extends Object
implements Parcelable
java.lang.Object
   ↳ android.app.assist.AssistContent

Class Overview

Holds information about the content an application is viewing, to hand to an assistant at the user's request. This is filled in by Activity.onProvideAssistContent.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<AssistContent> CREATOR
Public Constructors
AssistContent()
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
ClipData getClipData()
Return the current setClipData(ClipData), which you can modify in-place.
Bundle getExtras()
Return Bundle for extra vendor-specific data that can be modified and examined.
Intent getIntent()
Returns the current setIntent(Intent) if one is set, else the default Intent obtained from Activity.getIntent.
String getStructuredData()
Returns the current setStructuredData(String).
Uri getWebUri()
Return the content's web URI as per setWebUri(android.net.Uri), or null if there is none.
boolean isAppProvidedIntent()
Returns whether or not the current Intent was explicitly provided in Activity.onProvideAssistContent.
void setClipData(ClipData clip)
Optional additional content items that are involved with the current UI.
void setIntent(Intent intent)
Sets the Intent associated with the content, describing the current top-level context of the activity.
void setStructuredData(String structuredData)
Sets optional structured data regarding the content being viewed.
void setWebUri(Uri uri)
Set a web URI associated with the current data being shown to the user.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<AssistContent> CREATOR

Added in API level 23

Public Constructors

public AssistContent ()

Added in API level 23

Public Methods

public int describeContents ()

Added in API level 23

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public ClipData getClipData ()

Added in API level 23

Return the current setClipData(ClipData), which you can modify in-place.

public Bundle getExtras ()

Added in API level 23

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

public Intent getIntent ()

Added in API level 23

Returns the current setIntent(Intent) if one is set, else the default Intent obtained from Activity.getIntent. Can be modified in-place.

public String getStructuredData ()

Added in API level 23

Returns the current setStructuredData(String).

public Uri getWebUri ()

Added in API level 23

Return the content's web URI as per setWebUri(android.net.Uri), or null if there is none.

public boolean isAppProvidedIntent ()

Added in API level 23

Returns whether or not the current Intent was explicitly provided in Activity.onProvideAssistContent. If not, the Intent was automatically set based on Activity.getIntent.

public void setClipData (ClipData clip)

Added in API level 23

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 FLAG_GRANT_READ_URI_PERMISSION.

public void setIntent (Intent intent)

Added in API level 23

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 FLAG_GRANT_READ_URI_PERMISSION so the accessibility service can access it.

public void setStructuredData (String structuredData)

Added in API level 23

Sets optional structured data regarding the content being viewed. The provided data must be a string represented with JSON-LD using the schema.org vocabulary.

public void setWebUri (Uri uri)

Added in API level 23

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 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.

public void writeToParcel (Parcel dest, int flags)

Added in API level 23

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.