AssistContent
open class AssistContent : Parcelable
kotlin.Any | |
↳ | android.app.assist.AssistContent |
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
Inherited constants | |
---|---|
Public constructors | |
---|---|
Public methods | |
---|---|
open Int | |
open ClipData! |
Return the current |
open Bundle! |
Return Bundle for extra vendor-specific data that can be modified and examined. |
open Intent! |
Returns the current |
open String! |
Returns the current |
open Uri! |
Return the content's web URI as per |
open Boolean |
Returns whether or not the current Intent was explicitly provided in |
open Boolean |
Returns whether or not the current |
open Unit |
setClipData(clip: ClipData!) Optional additional content items that are involved with the current UI. |
open Unit |
Sets the Intent associated with the content, describing the current top-level context of the activity. |
open Unit |
setStructuredData(structuredData: String!) Sets optional structured data regarding the content being viewed. |
open Unit |
Set a web URI associated with the current data being shown to the user. |
open Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<AssistContent!> |
Public constructors
Public methods
describeContents
open fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getClipData
open fun getClipData(): ClipData!
Return the current setClipData
, which you can modify in-place.
getExtras
open fun getExtras(): Bundle!
Return Bundle for extra vendor-specific data that can be modified and examined.
getIntent
open fun getIntent(): Intent!
Returns the current setIntent
if one is set, else the default Intent obtained from Activity.getIntent
. Can be modified in-place.
getStructuredData
open fun getStructuredData(): String!
Returns the current setStructuredData
.
getWebUri
open fun getWebUri(): Uri!
Return the content's web URI as per setWebUri(android.net.Uri)
, or null if there is none.
isAppProvidedIntent
open fun isAppProvidedIntent(): Boolean
Returns whether or not the current Intent was explicitly provided in Activity.onProvideAssistContent
. If not, the Intent was automatically set based on Activity.getIntent
.
isAppProvidedWebUri
open fun isAppProvidedWebUri(): Boolean
Returns whether or not the current getWebUri
was explicitly provided in Activity.onProvideAssistContent
. If not, the Intent was automatically set based on Activity.getIntent
.
setClipData
open fun setClipData(clip: ClipData!): Unit
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 Intent#FLAG_GRANT_READ_URI_PERMISSION
.
setIntent
open fun setIntent(intent: Intent!): Unit
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 Intent#FLAG_GRANT_READ_URI_PERMISSION
so the accessibility service can access it.
setStructuredData
open fun setStructuredData(structuredData: String!): Unit
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.
setWebUri
open fun setWebUri(uri: Uri!): Unit
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 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.
writeToParcel
open fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |