# WallpaperDescription.Builder

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

# Builder

*** ** * ** ***

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

```
class Builder
```

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

Builder for the immutable[WallpaperDescription](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription)class

## Summary

|                                                                                                                       Public constructors                                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#Builder())`()` Creates a new, empty[Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#). |

|                                                                                                                                                                                                                                                                               Public methods                                                                                                                                                                                                                                                                               ||
|------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WallpaperDescription](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription)                  | [build](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#build())`()` Creates and returns the[WallpaperDescription](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription)represented by this builder.                                                                                                                                            |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setContent](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setContent(android.os.PersistableBundle))`(`content:` `[PersistableBundle](https://developer.android.com/reference/kotlin/android/os/PersistableBundle.html#)`)` Set the additional content required to render this wallpaper.                                                                                          |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setContextDescription](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setContextDescription(kotlin.CharSequence))`(`contextDescription:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?`)` Set the link text for the action associated with this wallpaper.                                                                       |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setContextUri](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setContextUri(android.net.Uri))`(`contextUri:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`)` Set the Uri for the action associated with this wallpaper, to be shown as a link with the wallpaper information.                                                                     |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setDescription](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setDescription(kotlin.collections.MutableList))`(`description:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)<[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!>`)` Set the description for this wallpaper. |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setId](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setId(kotlin.String))`(`id:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Set the id for this wallpaper.                                                                                                                                                                            |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setThumbnail](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setThumbnail(android.net.Uri))`(`thumbnail:` `[Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?`)` Set the thumbnail Uri for this wallpaper.                                                                                                                                               |
| [WallpaperDescription.Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#) | [setTitle](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#setTitle(kotlin.CharSequence))`(`title:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?`)` Set the title for this wallpaper.                                                                                                                                             |

## Public constructors

### Builder

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

```
Builder()
```

Creates a new, empty[Builder](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription.Builder#).

## Public methods

### build

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

```
fun build(): WallpaperDescription
```

Creates and returns the[WallpaperDescription](https://developer.android.com/reference/kotlin/android/app/wallpaper/WallpaperDescription)represented by this builder.  

### setContent

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

```
fun setContent(content: PersistableBundle): WallpaperDescription.Builder
```

Set the additional content required to render this wallpaper.

When setting additional content (asset id, etc.), best practice is to set an ID as well. This allows WallpaperManager and other code to distinguish between different wallpapers handled by this component.

|                                                                            Parameters                                                                             ||
|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| `content` | [PersistableBundle](https://developer.android.com/reference/kotlin/android/os/PersistableBundle.html#):additional content, or an empty bundle for none |

### setContextDescription

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

```
fun setContextDescription(contextDescription: CharSequence?): WallpaperDescription.Builder
```

Set the link text for the action associated with this wallpaper.

|                                                                          Parameters                                                                          ||
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `contextDescription` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?:the link text, or`null`for default text |

### setContextUri

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

```
fun setContextUri(contextUri: Uri?): WallpaperDescription.Builder
```

Set the Uri for the action associated with this wallpaper, to be shown as a link with the wallpaper information.

|                                                            Parameters                                                            ||
|--------------|--------------------------------------------------------------------------------------------------------------------|
| `contextUri` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?:the action Uri, or`null`for no action |

### setDescription

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

```
fun setDescription(description: MutableList<CharSequence!>): WallpaperDescription.Builder
```

Set the description for this wallpaper. Each array element should be shown on a different line.

|                                                                                                                             Parameters                                                                                                                              ||
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `description` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\<[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!\>:the description, or an empty list for none |

### setId

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

```
fun setId(id: String?): WallpaperDescription.Builder
```

Set the id for this wallpaper.

IDs are used to distinguish among different instances of wallpapers rendered by the same component, and should be unique among all wallpapers for that component.

|                                                    Parameters                                                    ||
|------|------------------------------------------------------------------------------------------------------------|
| `id` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?:the id, or`null`for none |

### setThumbnail

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

```
fun setThumbnail(thumbnail: Uri?): WallpaperDescription.Builder
```

Set the thumbnail Uri for this wallpaper.

|                                                          Parameters                                                           ||
|-------------|------------------------------------------------------------------------------------------------------------------|
| `thumbnail` | [Uri](https://developer.android.com/reference/kotlin/android/net/Uri.html#)?:the thumbnail Uri, or`null`for none |

### setTitle

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

```
fun setTitle(title: CharSequence?): WallpaperDescription.Builder
```

Set the title for this wallpaper.

|                                                             Parameters                                                              ||
|---------|----------------------------------------------------------------------------------------------------------------------------|
| `title` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)?:the title, or`null`for none |