# ContentInfoCompat.Builder

# ContentInfoCompat.Builder

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/view/ContentInfoCompat.java+class:androidx.core.view.ContentInfoCompat.Builder)  
Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

*** ** * ** ***

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

<br />

```
class ContentInfoCompat.Builder
```

<br />

*** ** * ** ***

Builder for[ContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat).

## Summary

|                                                                                                                                                                     ### Public constructors                                                                                                                                                                     |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder#Builder(androidx.core.view.ContentInfoCompat))`(other: `[ContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat)`)` Creates a new builder initialized with the data from the given object (shallow copy). |
| [Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder#Builder(android.content.ClipData,int))`(clip: `[ClipData](https://developer.android.com/reference/android/content/ClipData.html)`, source: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Creates a new builder.         |

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

## Public constructors

### Builder

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

```
Builder(other: ContentInfoCompat)
```

Creates a new builder initialized with the data from the given object (shallow copy).  

### Builder

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

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

Creates a new builder.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|-----------------------------------------------------|
| `clip: `[ClipData](https://developer.android.com/reference/android/content/ClipData.html) | The data to insert.                                 |
| `source: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)     | The source of the operation. See`SOURCE_`constants. |

## Public functions

### build

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

```
fun build(): ContentInfoCompat
```  

|                                                 Returns                                                  |
|----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [ContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat) | A new[ContentInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat)instance with the data from this builder. |

### setClip

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

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

Sets the data to be inserted.  

|                                        Parameters                                         |
|-------------------------------------------------------------------------------------------|---------------------|
| `clip: `[ClipData](https://developer.android.com/reference/android/content/ClipData.html) | The data to insert. |

|                                                         Returns                                                          |
|--------------------------------------------------------------------------------------------------------------------------|--------------|
| [ContentInfoCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder) | this builder |

### setExtras

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

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

Sets additional metadata.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|-------------------------------------------|
| `extras: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`?` | Optional bundle with additional metadata. |

|                                                         Returns                                                          |
|--------------------------------------------------------------------------------------------------------------------------|--------------|
| [ContentInfoCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder) | this builder |

### setFlags

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

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

Sets flags that control content insertion behavior.  

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
| `flags: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Optional flags to configure the insertion behavior. Use 0 for default behavior. See`FLAG_`constants. |

|                                                         Returns                                                          |
|--------------------------------------------------------------------------------------------------------------------------|--------------|
| [ContentInfoCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder) | this builder |

### setLinkUri

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

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

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

|                                    Parameters                                     |
|-----------------------------------------------------------------------------------|------------------------------------------|
| `linkUri: `[Uri](https://developer.android.com/reference/android/net/Uri.html)`?` | Optional http/https URI for the content. |

|                                                         Returns                                                          |
|--------------------------------------------------------------------------------------------------------------------------|--------------|
| [ContentInfoCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder) | this builder |

### setSource

Added in[1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)  

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

Sets the source of the operation.  

|                                      Parameters                                       |
|---------------------------------------------------------------------------------------|-----------------------------------------------------|
| `source: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The source of the operation. See`SOURCE_`constants. |

|                                                         Returns                                                          |
|--------------------------------------------------------------------------------------------------------------------------|--------------|
| [ContentInfoCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/ContentInfoCompat.Builder) | this builder |