# ActivityManager.TaskDescription

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

# TaskDescription

*** ** * ** ***

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

```
open class TaskDescription : Parcelable
```

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

Information you can set and retrieve about the current activity within the recent task list.

## Summary

|                                                                                                                                                Nested classes                                                                                                                                                ||
|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder) Provides a convenient way to set the fields of a[TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#)when creating a new instance. |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                                                              Public constructors                                                                                                                                                                                                                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription())`()` Creates an empty TaskDescription.                                                                                                                                                                                                                                                                                                                                                                       |
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription(android.app.ActivityManager.TaskDescription))`(`td:` `[ActivityManager.TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#)!`)` Creates a copy of another TaskDescription.                                                                                                                                                                            |
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription(kotlin.String))`(`label:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Creates the TaskDescription to the specified values.                                                                                                                                                                                                                                           |
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription(kotlin.String,%20android.graphics.Bitmap))`(`label:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `icon:` `[Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!`)` Creates the TaskDescription to the specified values.                                                                                                             |
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription(kotlin.String,%20android.graphics.Bitmap,%20kotlin.Int))`(`label:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `icon:` `[Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!`, `colorPrimary:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates the TaskDescription to the specified values. |
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription(kotlin.String,%20kotlin.Int))`(`label:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `iconRes:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates the TaskDescription to the specified values.                                                                                                                                    |
| [TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#TaskDescription(kotlin.String,%20kotlin.Int,%20kotlin.Int))`(`label:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `iconRes:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `colorPrimary:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates the TaskDescription to the specified values.                        |

|                                                                                                                                                                                                                   Public methods                                                                                                                                                                                                                    ||
|---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)              | [describeContents](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#describeContents())`()` <br />                                                                                                                                                                                                           |
| open[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)      | [equals](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Indicates whether some other object is "equal to" this one.                                                                          |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)              | [getBackgroundColor](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#getBackgroundColor())`()` <br />                                                                                                                                                                                                       |
| open[Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)! | [getIcon](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#getIcon())`()` <br />                                                                                                                                                                                                                             |
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!       | [getLabel](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#getLabel())`()` <br />                                                                                                                                                                                                                           |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)              | [getNavigationBarColor](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#getNavigationBarColor())`()` <br />                                                                                                                                                                                                 |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)              | [getPrimaryColor](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#getPrimaryColor())`()` <br />                                                                                                                                                                                                             |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)              | [getStatusBarColor](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#getStatusBarColor())`()` <br />                                                                                                                                                                                                         |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)              | [hashCode](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#hashCode())`()` <br />                                                                                                                                                                                                                           |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)            | [readFromParcel](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#readFromParcel(android.os.Parcel))`(`source:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)!`)` <br />                                                                                                 |
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)        | [toString](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#toString())`()` <br />                                                                                                                                                                                                                           |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)            | [writeToParcel](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`dest:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> |

|                                                                                                                                                                                              Properties                                                                                                                                                                                               ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[ActivityManager.TaskDescription](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription#CREATOR:android.os.Parcelable.Creator) <br /> |

## Public constructors

### TaskDescription

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

```
TaskDescription()
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder)instead.*

Creates an empty TaskDescription.  

### TaskDescription

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

```
TaskDescription(td: ActivityManager.TaskDescription!)
```

Creates a copy of another TaskDescription.  

### TaskDescription

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

```
TaskDescription(label: String!)
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder)instead.*

Creates the TaskDescription to the specified values.

|                                                                        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. |

### TaskDescription

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

```
TaskDescription(
    label: String!, 
    icon: Bitmap!)
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder)instead.*

Creates the TaskDescription to the specified values.

|                                                                          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.    |
| `icon`  | [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!:An icon that represents the current state of this activity. |

### TaskDescription

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

```
TaskDescription(
    label: String!, 
    icon: Bitmap!, 
    colorPrimary: Int)
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder)instead.*

Creates the TaskDescription to the specified values.

|                                                                              Parameters                                                                              ||
|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `label`        | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:A label and description of the current state of this task.         |
| `icon`         | [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)!:An icon that represents the current state of this task.      |
| `colorPrimary` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):A color to override the theme's primary color. This color must be opaque. |

### TaskDescription

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

```
TaskDescription(
    label: String!, 
    iconRes: Int)
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder)instead.*

Creates the TaskDescription to the specified values.

|                                                                                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.              |
| `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. |

### TaskDescription

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

```
TaskDescription(
    label: String!, 
    iconRes: Int, 
    colorPrimary: Int)
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/app/ActivityManager.TaskDescription.Builder)instead.*

Creates the TaskDescription to the specified values.

|                                                                                  Parameters                                                                                   ||
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `label`        | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:A label and description of the current state of this task.                  |
| `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. |
| `colorPrimary` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):A color to override the theme's primary color. This color must be opaque.          |

## Public methods

### describeContents

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

```
open fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### equals

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

```
open fun equals(other: Any?): Boolean
```

Indicates whether some other object is "equal to" this one.

The`equals`method implements an equivalence relation on non-null object references:

- It is*reflexive* : for any non-null reference value`x`,`x.equals(x)`should return`true`.
- It is*symmetric* : for any non-null reference values`x`and`y`,`x.equals(y)`should return`true`if and only if`y.equals(x)`returns`true`.
- It is*transitive* : for any non-null reference values`x`,`y`, and`z`, if`x.equals(y)`returns`true`and`y.equals(z)`returns`true`, then`x.equals(z)`should return`true`.
- It is*consistent* : for any non-null reference values`x`and`y`, multiple invocations of`x.equals(y)`consistently return`true`or consistently return`false`, provided no information used in`equals`comparisons on the objects is modified.
- For any non-null reference value`x`,`x.equals(null)`should return`false`.

An equivalence relation partitions the elements it operates on into*equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

|           Parameters            ||
|-------|--------------------------|
| `obj` | This value may be`null`. |

|                                                                           Return                                                                           ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true`if this object is the same as the obj argument;`false`otherwise. |

### getBackgroundColor

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

```
open fun getBackgroundColor(): Int
```

|                                                             Return                                                              ||
|----------------------------------------------------------------------------|-----------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The color override on the theme's background color. |

### getIcon

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

```
open fun getIcon(): Bitmap!
```

**Deprecated:** *This call is no longer supported. The caller should keep track of any icons it sets for the task descriptions internally.*

|                                                                                Return                                                                                 ||
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| [Bitmap](https://developer.android.com/reference/kotlin/android/graphics/Bitmap.html#)! | The in-memory or loaded icon that represents the current state of this task. |

### getLabel

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

```
open fun getLabel(): String!
```

|                                                                     Return                                                                      ||
|-----------------------------------------------------------------------------------|--------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | The label and description of the current state of this task. |

### getNavigationBarColor

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

```
open fun getNavigationBarColor(): Int
```

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

### getPrimaryColor

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

```
open fun getPrimaryColor(): Int
```

|                                                            Return                                                            ||
|----------------------------------------------------------------------------|--------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The color override on the theme's primary color. |

### getStatusBarColor

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

```
open fun getStatusBarColor(): Int
```

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

### hashCode

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

```
open fun hashCode(): Int
```

|                                                     Return                                                     ||
|----------------------------------------------------------------------------|------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |

### readFromParcel

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

```
open fun readFromParcel(source: Parcel!): Unit
```  

### toString

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

```
open fun toString(): String
```

|                                                          Return                                                          ||
|----------------------------------------------------------------------------------|----------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |

### writeToParcel

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

```
open fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#):The Parcel in which the object should be written. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                            |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

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

```
static val CREATOR: Parcelable.Creator<ActivityManager.TaskDescription!>
```