# ContentInfo

Added in[API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/view/ContentInfo#nestedclasses)\|[Constants](https://developer.android.com/reference/android/view/ContentInfo#constants)\|[Inherited Constants](https://developer.android.com/reference/android/view/ContentInfo#inhconstants)\|[Fields](https://developer.android.com/reference/android/view/ContentInfo#lfields)\|[Methods](https://developer.android.com/reference/android/view/ContentInfo#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/ContentInfo#inhmethods)  

# ContentInfo

*** ** * ** ***

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

`
public

final

class
ContentInfo
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


implements

`[Parcelable](https://developer.android.com/reference/android/os/Parcelable)`


`

|---|--------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.ContentInfo |

<br />

*** ** * ** ***

Holds all the relevant data for a request to[View.performReceiveContent](https://developer.android.com/reference/android/view/View#performReceiveContent(android.view.ContentInfo)).

## Summary

|                                                                                          ### Nested classes                                                                                           ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [ContentInfo.Builder](https://developer.android.com/reference/android/view/ContentInfo.Builder) Builder for[ContentInfo](https://developer.android.com/reference/android/view/ContentInfo). |

|                                                                                                                                                  ### Constants                                                                                                                                                  ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [FLAG_CONVERT_TO_PLAIN_TEXT](https://developer.android.com/reference/android/view/ContentInfo#FLAG_CONVERT_TO_PLAIN_TEXT) Flag requesting that the content should be converted to plain text prior to inserting.                                                                                         |
| `int` | [SOURCE_APP](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_APP) Specifies that the operation was triggered by the app that contains the target view.                                                                                                                           |
| `int` | [SOURCE_AUTOFILL](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_AUTOFILL) Specifies that the operation was triggered by the autofill framework.                                                                                                                                |
| `int` | [SOURCE_CLIPBOARD](https://developer.android.com/reference/android/view/ContentInfo#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](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_DRAG_AND_DROP) Specifies that the operation was triggered by the drag/drop framework.                                                                                                                     |
| `int` | [SOURCE_INPUT_METHOD](https://developer.android.com/reference/android/view/ContentInfo#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](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_PROCESS_TEXT) Specifies that the operation was triggered by a result from a[PROCESS_TEXT](https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT)action in the selection menu. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable) |-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) Descriptor bit used with[describeContents()](https://developer.android.com/reference/android/os/Parcelable#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor.                                                                                                                                            | | `int` | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE) Flag for use with[writeToParcel(Parcel, int)](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 `[Creator](https://developer.android.com/reference/android/os/Parcelable.Creator)`<`[ContentInfo](https://developer.android.com/reference/android/view/ContentInfo)`>` | [CREATOR](https://developer.android.com/reference/android/view/ContentInfo#CREATOR) Creates[ContentInfo](https://developer.android.com/reference/android/view/ContentInfo)instances from parcels. |

|                                                                                                                                                                ### Public methods                                                                                                                                                                 ||
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                          | ` `[describeContents](https://developer.android.com/reference/android/view/ContentInfo#describeContents())`() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.                                          |
| ` `[ClipData](https://developer.android.com/reference/android/content/ClipData) | ` `[getClip](https://developer.android.com/reference/android/view/ContentInfo#getClip())`() ` The data to be inserted.                                                                                                                                           |
| ` `[Bundle](https://developer.android.com/reference/android/os/Bundle)          | ` `[getExtras](https://developer.android.com/reference/android/view/ContentInfo#getExtras())`() ` Optional additional metadata.                                                                                                                                  |
| ` int`                                                                          | ` `[getFlags](https://developer.android.com/reference/android/view/ContentInfo#getFlags())`() ` Optional flags that control the insertion behavior.                                                                                                              |
| ` `[Uri](https://developer.android.com/reference/android/net/Uri)               | ` `[getLinkUri](https://developer.android.com/reference/android/view/ContentInfo#getLinkUri())`() ` Optional http/https URI for the content that may be provided by the IME.                                                                                     |
| ` int`                                                                          | ` `[getSource](https://developer.android.com/reference/android/view/ContentInfo#getSource())`() ` The source of the operation.                                                                                                                                   |
| ` `[String](https://developer.android.com/reference/java/lang/String)           | ` `[toString](https://developer.android.com/reference/android/view/ContentInfo#toString())`() ` Returns a string representation of the object.                                                                                                                   |
| ` void`                                                                         | ` `[writeToParcel](https://developer.android.com/reference/android/view/ContentInfo#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Writes this object into the given parcel. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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` `[android.os.Parcelable](https://developer.android.com/reference/android/os/Parcelable)` ` |------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract int`  | ` `[describeContents](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` | ` `[writeToParcel](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int))`(`[Parcel](https://developer.android.com/reference/android/os/Parcel)` dest, int flags) ` Flatten this object in to a Parcel. | ||

## Constants

### FLAG_CONVERT_TO_PLAIN_TEXT

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

```
public static final int FLAG_CONVERT_TO_PLAIN_TEXT
```

Flag requesting that the content should be converted to plain text prior to inserting.

<br />

Constant Value: 1 (0x00000001)  

### SOURCE_APP

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

```
public static final int SOURCE_APP
```

Specifies that the operation was triggered by the app that contains the target view.

<br />

Constant Value: 0 (0x00000000)  

### SOURCE_AUTOFILL

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

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

<br />

Constant Value: 4 (0x00000004)  

### SOURCE_CLIPBOARD

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

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

<br />

Constant Value: 1 (0x00000001)  

### SOURCE_DRAG_AND_DROP

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

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

<br />

Constant Value: 3 (0x00000003)  

### SOURCE_INPUT_METHOD

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

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

<br />

Constant Value: 2 (0x00000002)  

### SOURCE_PROCESS_TEXT

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

```
public static final int SOURCE_PROCESS_TEXT
```

Specifies that the operation was triggered by a result from a[PROCESS_TEXT](https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT)action in the selection menu.

<br />

Constant Value: 5 (0x00000005)

## Fields

### CREATOR

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

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

Creates[ContentInfo](https://developer.android.com/reference/android/view/ContentInfo)instances from parcels.

<br />

## Public methods

### describeContents

Added in[API level 31](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[writeToParcel(android.os.Parcel, int)](https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)), the return value of this method must include the[CONTENTS_FILE_DESCRIPTOR](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[CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR) <br /> |

### getClip

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

```
public ClipData getClip ()
```

The data to be inserted.

<br />

|                                                     Returns                                                      ||
|------------------------------------------------------------------------------|------------------------------------|
| [ClipData](https://developer.android.com/reference/android/content/ClipData) | This value cannot be`null`. <br /> |

### getExtras

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

```
public Bundle getExtras ()
```

Optional additional metadata. If the source is[SOURCE_INPUT_METHOD](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_INPUT_METHOD), this will include the[opts](https://developer.android.com/reference/android/view/inputmethod/InputConnection#commitContent(android.view.inputmethod.InputContentInfo,%20int,%20android.os.Bundle))passed by the IME.

<br />

|                                               Returns                                                ||
|---------------------------------------------------------------------|---------------------------------|
| [Bundle](https://developer.android.com/reference/android/os/Bundle) | This value may be`null`. <br /> |

### getFlags

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

```
public int getFlags ()
```

Optional flags that control the insertion behavior. See`FLAG_`constants.

<br />

|                                                                           Returns                                                                           ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is either`0`or[FLAG_CONVERT_TO_PLAIN_TEXT](https://developer.android.com/reference/android/view/ContentInfo#FLAG_CONVERT_TO_PLAIN_TEXT) <br /> |

### getLinkUri

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

```
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](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_INPUT_METHOD)and if a non-empty[linkUri](https://developer.android.com/reference/android/view/inputmethod/InputContentInfo#getLinkUri())was passed by the IME.

<br />

|                                             Returns                                             ||
|----------------------------------------------------------------|---------------------------------|
| [Uri](https://developer.android.com/reference/android/net/Uri) | This value may be`null`. <br /> |

### getSource

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

```
public int getSource ()
```

The source of the operation. See`SOURCE_`constants. Future versions of Android may pass additional values.

<br />

|                                                                                                                                                                                                                                                                                                                              Returns                                                                                                                                                                                                                                                                                                                               ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Value is[SOURCE_APP](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_APP),[SOURCE_CLIPBOARD](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_CLIPBOARD),[SOURCE_INPUT_METHOD](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_INPUT_METHOD),[SOURCE_DRAG_AND_DROP](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_DRAG_AND_DROP),[SOURCE_AUTOFILL](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_AUTOFILL), or[SOURCE_PROCESS_TEXT](https://developer.android.com/reference/android/view/ContentInfo#SOURCE_PROCESS_TEXT) <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                Returns                                                 ||
|--------------------------------------------------------------------|------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | This value cannot be`null`. <br /> |

### writeToParcel

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

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

Writes this object into the given parcel.

<br />

|                                   Parameters                                    ||
|---------|------------------------------------------------------------------------|
| `dest`  | `Parcel`: The parcel to write into. This value cannot be`null`. <br /> |
| `flags` | `int`: The flags to use for parceling. <br />                          |