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

# Builder

*** ** * ** ***

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

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.view.ContentInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#) |

Builder for `https://developer.android.com/reference/kotlin/android/view/ContentInfo`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#Builder(android.content.ClipData,%20kotlin.Int)(clip: https://developer.android.com/reference/kotlin/android/content/ClipData.html#, source: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Creates a new builder. |
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#Builder(android.view.ContentInfo)(other: https://developer.android.com/reference/kotlin/android/view/ContentInfo)` Creates a new builder initialized with the data from the given builder. |

| Public methods ||
|---|---|
| [ContentInfo](https://developer.android.com/reference/kotlin/android/view/ContentInfo) | `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#build()()` <br /> |
| [ContentInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#) | `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#setClip(android.content.ClipData)(clip: https://developer.android.com/reference/kotlin/android/content/ClipData.html#)` Sets the data to be inserted. |
| [ContentInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#) | `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#setExtras(android.os.Bundle)(extras: https://developer.android.com/reference/kotlin/android/os/Bundle.html#?)` Sets additional metadata. |
| [ContentInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#) | `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#setFlags(kotlin.Int)(flags: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets flags that control content insertion behavior. |
| [ContentInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#) | `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#setLinkUri(android.net.Uri)(linkUri: https://developer.android.com/reference/kotlin/android/net/Uri.html#?)` Sets the http/https URI for the content. |
| [ContentInfo.Builder](https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#) | `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#setSource(kotlin.Int)(source: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Sets the source of the operation. |

## Public constructors

### Builder

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

```
Builder(
    clip: ClipData, 
    source: Int)
```

Creates a new builder.

| Parameters ||
|---|---|
| `clip` | [ClipData](https://developer.android.com/reference/kotlin/android/content/ClipData.html#): The data to insert. This value cannot be `null`. |
| `source` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The source of the operation. See `SOURCE_` constants. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_APP:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_CLIPBOARD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_INPUT_METHOD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_DRAG_AND_DROP:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_AUTOFILL:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_PROCESS_TEXT:kotlin.Int` |

### Builder

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

```
Builder(other: ContentInfo)
```

Creates a new builder initialized with the data from the given builder.

| Parameters ||
|---|---|
| `other` | [ContentInfo](https://developer.android.com/reference/kotlin/android/view/ContentInfo): This value cannot be `null`. |

## Public methods

### build

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

```
fun build(): ContentInfo
```

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo` | A new `https://developer.android.com/reference/kotlin/android/view/ContentInfo` instance with the data from this builder. This value cannot be `null`. |

### setClip

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

```
fun setClip(clip: ClipData): ContentInfo.Builder
```

Sets the data to be inserted.

| Parameters ||
|---|---|
| `clip` | [ClipData](https://developer.android.com/reference/kotlin/android/content/ClipData.html#): The data to insert. This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#` | this builder. This value cannot be `null`. |

### setExtras

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

```
fun setExtras(extras: Bundle?): ContentInfo.Builder
```

Sets additional metadata.

| Parameters ||
|---|---|
| `extras` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)?: Optional bundle with additional metadata. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#` | this builder. This value cannot be `null`. |

### setFlags

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

```
fun setFlags(flags: Int): ContentInfo.Builder
```

Sets flags that control content insertion behavior.

| Parameters ||
|---|---|
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Optional flags to configure the insertion behavior. Use 0 for default behavior. See `FLAG_` constants. Value is either `0` or - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#FLAG_CONVERT_TO_PLAIN_TEXT:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#` | this builder. This value cannot be `null`. |

### setLinkUri

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

```
fun setLinkUri(linkUri: Uri?): ContentInfo.Builder
```

Sets the http/https URI for the content. See `https://developer.android.com/reference/kotlin/android/view/inputmethod/InputContentInfo#getLinkUri()` for more info.

| Parameters ||
|---|---|
| `linkUri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?: Optional http/https URI for the content. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#` | this builder. This value cannot be `null`. |

### setSource

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

```
fun setSource(source: Int): ContentInfo.Builder
```

Sets the source of the operation.

| Parameters ||
|---|---|
| `source` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The source of the operation. See `SOURCE_` constants. Value is one of the following: - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_APP:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_CLIPBOARD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_INPUT_METHOD:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_DRAG_AND_DROP:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_AUTOFILL:kotlin.Int` - `https://developer.android.com/reference/kotlin/android/view/ContentInfo#SOURCE_PROCESS_TEXT:kotlin.Int` |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/view/ContentInfo.Builder#` | this builder. This value cannot be `null`. |