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

# Builder

*** ** * ** ***

```
class Builder
```

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

Provides a convenient way to set the fields of a `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription` when creating a new instance.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#Builder()()` <br /> |

| Public methods ||
|---|---|
| [ActivityManager.TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#build()()` Build the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setBackgroundColor(kotlin.Int)(color: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Set the background color to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setBadge(android.graphics.drawable.Icon)(badge: https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#?)` Set the icon of the badge to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setIcon(android.graphics.drawable.Icon)(icon: https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#?)` Set the icon to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setIcon(kotlin.Int)(iconRes: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Set the drawable resource of the icon to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setLabel(kotlin.String)(label: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?)` Set the label to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setNavigationBarColor(kotlin.Int)(color: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Set the navigation bar color to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setPrimaryColor(kotlin.Int)(color: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Set the primary color to use in the TaskDescription. |
| [ActivityManager.TaskDescription.Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#) | `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#setStatusBarColor(kotlin.Int)(color: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Set the status bar color to use in the TaskDescription. |

## Public constructors

### Builder

```
Builder()
```

## Public methods

### build

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

```
fun build(): ActivityManager.TaskDescription
```

Build the TaskDescription.

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription` | the TaskDescription object. This value cannot be `null`. |

### setBackgroundColor

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

```
fun setBackgroundColor(color: Int): ActivityManager.TaskDescription.Builder
```

Set the background color to use in the TaskDescription.

| Parameters ||
|---|---|
| `color` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A color to override the theme's background color. The color must be opaque. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setBadge

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

```
fun setBadge(badge: Icon?): ActivityManager.TaskDescription.Builder
```

Set the icon of the badge to use in the TaskDescription.

The badge is an optional, small icon that is displayed on bottom corner of the icon in places like the taskbar and launcher. There is no default badge, and if not set, no badge will be shown.

| Parameters ||
|---|---|
| `badge` | [Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#)?: An Icon of a badge to be attached to the icon. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setIcon

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

```
fun setIcon(icon: Icon?): ActivityManager.TaskDescription.Builder
```

Set the icon to use in the TaskDescription.

| Parameters ||
|---|---|
| `icon` | [Icon](https://developer.android.com/reference/kotlin/android/graphics/drawable/Icon.html#)?: An icon that represents the current state of this activity. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setIcon

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

```
fun setIcon(iconRes: Int): ActivityManager.TaskDescription.Builder
```

Set the drawable resource of the icon to use in the TaskDescription.

| Parameters ||
|---|---|
| `iconRes` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A drawable resource of an icon that represents the current state of this activity. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setLabel

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

```
fun setLabel(label: String?): ActivityManager.TaskDescription.Builder
```

Set the label to use in the TaskDescription.

| Parameters ||
|---|---|
| `label` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: A label and description of the current state of this activity. This value may be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setNavigationBarColor

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

```
fun setNavigationBarColor(color: Int): ActivityManager.TaskDescription.Builder
```

Set the navigation bar color to use in the TaskDescription.

| Parameters ||
|---|---|
| `color` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A color to override the theme's navigation bar color. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setPrimaryColor

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

```
fun setPrimaryColor(color: Int): ActivityManager.TaskDescription.Builder
```

Set the primary color to use in the TaskDescription.

| Parameters ||
|---|---|
| `color` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A color to override the theme's primary color. The color must be opaque. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |

### setStatusBarColor

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

```
fun setStatusBarColor(color: Int): ActivityManager.TaskDescription.Builder
```

Set the status bar color to use in the TaskDescription.

| Parameters ||
|---|---|
| `color` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): A color to override the theme's status bar color. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder#` | The same instance of the builder. This value cannot be `null`. |