public
final
class
ContentInfo
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.view.ContentInfo |
Holds all the relevant data for a request to View.performReceiveContent.
classContentInfo.Builder
Builder for ContentInfo.
Constants | |
|---|---|
int |
FLAG_CONVERT_TO_PLAIN_TEXT
Flag requesting that the content should be converted to plain text prior to inserting. |
int |
SOURCE_APP
Specifies that the operation was triggered by the app that contains the target view. |
int |
SOURCE_AUTOFILL
Specifies that the operation was triggered by the autofill framework. |
int |
SOURCE_CLIPBOARD
Specifies that the operation was triggered by a paste from the clipboard (e.g. "Paste" or "Paste as plain text" action in the insertion/selection menu). |
int |
SOURCE_DRAG_AND_DROP
Specifies that the operation was triggered by the drag/drop framework. |
int |
SOURCE_INPUT_METHOD
Specifies that the operation was triggered from the soft keyboard (also known as input method editor or IME). |
int |
SOURCE_PROCESS_TEXT
Specifies that the operation was triggered by a result from a
|
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<ContentInfo> |
CREATOR
Creates |
Public methods | |
|---|---|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
ClipData
|
getClip()
The data to be inserted. |
Bundle
|
getExtras()
Optional additional metadata. |
int
|
getFlags()
Optional flags that control the insertion behavior. |
Uri
|
getLinkUri()
Optional http/https URI for the content that may be provided by the IME. |
int
|
getSource()
The source of the operation. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Writes this object into the given parcel. |
Inherited methods | |
|---|---|
public static final int FLAG_CONVERT_TO_PLAIN_TEXT
Flag requesting that the content should be converted to plain text prior to inserting.
Constant Value: 1 (0x00000001)
public static final int SOURCE_APP
Specifies that the operation was triggered by the app that contains the target view.
Constant Value: 0 (0x00000000)
public static final int SOURCE_AUTOFILL
Specifies that the operation was triggered by the autofill framework. See https://developer.android.com/guide/topics/text/autofill for more info.
Constant Value: 4 (0x00000004)
public static final int SOURCE_CLIPBOARD
Specifies that the operation was triggered by a paste from the clipboard (e.g. "Paste" or "Paste as plain text" action in the insertion/selection menu).
Constant Value: 1 (0x00000001)
public static final int SOURCE_DRAG_AND_DROP
Specifies that the operation was triggered by the drag/drop framework. See https://developer.android.com/guide/topics/ui/drag-drop for more info.
Constant Value: 3 (0x00000003)
public static final int SOURCE_INPUT_METHOD
Specifies that the operation was triggered from the soft keyboard (also known as input method editor or IME). See https://developer.android.com/guide/topics/text/image-keyboard for more info.
Constant Value: 2 (0x00000002)
public static final int SOURCE_PROCESS_TEXT
Specifies that the operation was triggered by a result from a
PROCESS_TEXT action in the selection
menu.
Constant Value: 5 (0x00000005)
public static final Creator<ContentInfo> CREATOR
Creates ContentInfo instances from parcels.
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 writeToParcel(Parcel,int),
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR bit.
int0 or
public ClipData getClip ()
The data to be inserted.
| Returns | |
|---|---|
ClipData |
This value cannot be null. |
public Bundle getExtras ()
Optional additional metadata. If the source is SOURCE_INPUT_METHOD, this will
include the opts passed by
the IME.
| Returns | |
|---|---|
Bundle |
This value may be null. |
public int getFlags ()
Optional flags that control the insertion behavior. See FLAG_ constants.
int0 or
public Uri getLinkUri ()
Optional http/https URI for the content that may be provided by the IME. This is only
populated if the source is SOURCE_INPUT_METHOD and if a non-empty
linkUri was passed by the
IME.
| Returns | |
|---|---|
Uri |
This value may be null. |
public int getSource ()
The source of the operation. See SOURCE_ constants. Future versions of Android
may pass additional values.
intSOURCE_APPSOURCE_CLIPBOARDSOURCE_INPUT_METHODSOURCE_DRAG_AND_DROPSOURCE_AUTOFILLSOURCE_PROCESS_TEXTpublic String toString ()
Returns a string representation of the object.
| Returns | |
|---|---|
String |
This value cannot be null. |
public void writeToParcel (Parcel dest, int flags)
Writes this object into the given parcel.
| Parameters | |
|---|---|
dest |
Parcel: The parcel to write into.
This value cannot be null. |
flags |
int: The flags to use for parceling. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-02-26 UTC.