# ClipData.Item.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

A builder for a ClipData Item.

## Summary

|                                                   Public constructors                                                   ||
|----------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#Builder())`()` <br /> |

|                                                                                                                                                                                                                                                       Public methods                                                                                                                                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ClipData.Item](https://developer.android.com/reference/kotlin/android/content/ClipData.Item)                  | [build](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#build())`()` Constructs a new Item with the properties set on this builder.                                                                                                                                                                                                                                   |
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | [setHtmlText](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#setHtmlText(kotlin.String))`(`htmlText:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Sets the HTML text for the item to be constructed.                                                                                                                       |
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | [setIntent](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#setIntent(android.content.Intent))`(`intent:` `[Intent](https://developer.android.com/reference/kotlin/android/content/Intent)?`)` Sets the Intent for the item to be constructed.                                                                                                                        |
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | [setIntentSender](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#setIntentSender(android.content.IntentSender))`(`intentSender:` `[IntentSender](https://developer.android.com/reference/kotlin/android/content/IntentSender)?`)` Sets the[IntentSender](https://developer.android.com/reference/kotlin/android/content/IntentSender)for the item to be constructed. |
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | [setText](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#setText(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?`)` Sets the text for the item to be constructed.                                                                                                                     |
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | [setUri](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#setUri(android.net.Uri))`(`uri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`)` Sets the URI for the item to be constructed.                                                                                                                                               |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### build

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

```
fun build(): ClipData.Item
```

Constructs a new Item with the properties set on this builder.

|                                                           Return                                                           ||
|-----------------------------------------------------------------------------------------------|-----------------------------|
| [ClipData.Item](https://developer.android.com/reference/kotlin/android/content/ClipData.Item) | This value cannot be`null`. |

### setHtmlText

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

```
fun setHtmlText(htmlText: String?): ClipData.Item.Builder
```

Sets the HTML text for the item to be constructed.

|                                                       Parameters                                                       ||
|------------|------------------------------------------------------------------------------------------------------------|
| `htmlText` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:This value may be`null`. |

|                                                                   Return                                                                    ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | This value cannot be`null`. |

### setIntent

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

```
fun setIntent(intent: Intent?): ClipData.Item.Builder
```

Sets the Intent for the item to be constructed.

|                                                     Parameters                                                      ||
|----------|-----------------------------------------------------------------------------------------------------------|
| `intent` | [Intent](https://developer.android.com/reference/kotlin/android/content/Intent)?:This value may be`null`. |

|                                                                   Return                                                                    ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | This value cannot be`null`. |

### setIntentSender

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

```
fun setIntentSender(intentSender: IntentSender?): ClipData.Item.Builder
```

Sets the[IntentSender](https://developer.android.com/reference/kotlin/android/content/IntentSender)for the item to be constructed. To prevent receiving apps from improperly manipulating the intent to launch another activity as this caller, the provided IntentSender must be immutable. If there is a fixed lifetime for this ClipData (ie. for drag and drop), the system will cancel the IntentSender when it is no longer used.

|                                                              Parameters                                                               ||
|----------------|-----------------------------------------------------------------------------------------------------------------------|
| `intentSender` | [IntentSender](https://developer.android.com/reference/kotlin/android/content/IntentSender)?:This value may be`null`. |

|                                                                   Return                                                                    ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | This value cannot be`null`. |

### setText

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

```
fun setText(text: CharSequence?): ClipData.Item.Builder
```

Sets the text for the item to be constructed.

|                                                           Parameters                                                            ||
|--------|-------------------------------------------------------------------------------------------------------------------------|
| `text` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?:This value may be`null`. |

|                                                                   Return                                                                    ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | This value cannot be`null`. |

### setUri

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

```
fun setUri(uri: Uri?): ClipData.Item.Builder
```

Sets the URI for the item to be constructed.

|                                                  Parameters                                                  ||
|-------|-------------------------------------------------------------------------------------------------------|
| `uri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?:This value may be`null`. |

|                                                                   Return                                                                    ||
|----------------------------------------------------------------------------------------------------------------|-----------------------------|
| [ClipData.Item.Builder](https://developer.android.com/reference/kotlin/android/content/ClipData.Item.Builder#) | This value cannot be`null`. |