Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#inhmethods)

# ActivityManager.TaskDescription.Builder

*** ** * ** ***

` public static final class ActivityManager.TaskDescription.Builder `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.app.ActivityManager.TaskDescription.Builder |

<br />

*** ** * ** ***

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

## Summary

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

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#build()() ` Build the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setBackgroundColor(int)(int color) ` Set the background color to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setBadge(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon badge) ` Set the icon of the badge to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setIcon(int)(int iconRes) ` Set the drawable resource of the icon to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setIcon(android.graphics.drawable.Icon)(https://developer.android.com/reference/android/graphics/drawable/Icon icon) ` Set the icon to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setLabel(java.lang.String)(https://developer.android.com/reference/java/lang/String label) ` Set the label to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setNavigationBarColor(int)(int color) ` Set the navigation bar color to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setPrimaryColor(int)(int color) ` Set the primary color to use in the TaskDescription. |
| ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | ` https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder#setStatusBarColor(int)(int color) ` Set the status bar color to use in the TaskDescription. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public constructors

### Builder

```
public Builder ()
```

<br />

<br />

## Public methods

### build

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

```
public ActivityManager.TaskDescription build ()
```

Build the TaskDescription.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription` | the TaskDescription object. This value cannot be `null`. <br /> |

### setBackgroundColor

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

```
public ActivityManager.TaskDescription.Builder setBackgroundColor (int color)
```

Set the background color to use in the TaskDescription.

<br />

| Parameters ||
|---|---|
| `color` | `int`: A color to override the theme's background color. The color must be opaque. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setBadge

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

```
public ActivityManager.TaskDescription.Builder setBadge (Icon badge)
```

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.

<br />

| Parameters ||
|---|---|
| `badge` | `Icon`: An Icon of a badge to be attached to the icon. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setIcon

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

```
public ActivityManager.TaskDescription.Builder setIcon (int iconRes)
```

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

<br />

| Parameters ||
|---|---|
| `iconRes` | `int`: A drawable resource of an icon that represents the current state of this activity. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setIcon

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

```
public ActivityManager.TaskDescription.Builder setIcon (Icon icon)
```

Set the icon to use in the TaskDescription.

<br />

| Parameters ||
|---|---|
| `icon` | `Icon`: An icon that represents the current state of this activity. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setLabel

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

```
public ActivityManager.TaskDescription.Builder setLabel (String label)
```

Set the label to use in the TaskDescription.

<br />

| Parameters ||
|---|---|
| `label` | `String`: A label and description of the current state of this activity. This value may be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setNavigationBarColor

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

```
public ActivityManager.TaskDescription.Builder setNavigationBarColor (int color)
```

Set the navigation bar color to use in the TaskDescription.

<br />

| Parameters ||
|---|---|
| `color` | `int`: A color to override the theme's navigation bar color. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setPrimaryColor

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

```
public ActivityManager.TaskDescription.Builder setPrimaryColor (int color)
```

Set the primary color to use in the TaskDescription.

<br />

| Parameters ||
|---|---|
| `color` | `int`: A color to override the theme's primary color. The color must be opaque. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |

### setStatusBarColor

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

```
public ActivityManager.TaskDescription.Builder setStatusBarColor (int color)
```

Set the status bar color to use in the TaskDescription.

<br />

| Parameters ||
|---|---|
| `color` | `int`: A color to override the theme's status bar color. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/ActivityManager.TaskDescription.Builder` | The same instance of the builder. This value cannot be `null`. <br /> |