Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Fields](https://developer.android.com/reference/android/app/TaskInfo#lfields) \| [Methods](https://developer.android.com/reference/android/app/TaskInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/TaskInfo#inhmethods)

# TaskInfo

*** ** * ** ***


`
public


class
TaskInfo
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

Known direct subclasses [ActivityManager.RecentTaskInfo](https://developer.android.com/reference/android/app/ActivityManager.RecentTaskInfo), [ActivityManager.RunningTaskInfo](https://developer.android.com/reference/android/app/ActivityManager.RunningTaskInfo) [ActivityManager.RecentTaskInfo](https://developer.android.com/reference/android/app/ActivityManager.RecentTaskInfo) Information you can retrieve about tasks that the user has most recently started or visited. [ActivityManager.RunningTaskInfo](https://developer.android.com/reference/android/app/ActivityManager.RunningTaskInfo) Information you can retrieve about a particular task that is currently "running" in the system.   

*** ** * ** ***

Stores information about a particular Task.

## Summary

| ### Fields ||
|---|---|
| ` public https://developer.android.com/reference/android/content/ComponentName` | `https://developer.android.com/reference/android/app/TaskInfo#baseActivity` The component of the first activity in the task, can be considered the "application" of this task. |
| ` public https://developer.android.com/reference/android/content/Intent` | `https://developer.android.com/reference/android/app/TaskInfo#baseIntent` The base intent of the task (generally the intent that launched the task). |
| ` public boolean` | `https://developer.android.com/reference/android/app/TaskInfo#isRunning` Whether or not this task has any running activities. |
| ` public int` | `https://developer.android.com/reference/android/app/TaskInfo#numActivities` The number of activities in this task (including running). |
| ` public https://developer.android.com/reference/android/content/ComponentName` | `https://developer.android.com/reference/android/app/TaskInfo#origActivity` The component of the target activity if this task was started from an activity alias. |
| ` public https://developer.android.com/reference/android/app/ActivityManager.TaskDescription` | `https://developer.android.com/reference/android/app/TaskInfo#taskDescription` The recent activity values for the highest activity in the stack to have set the values. |
| ` public int` | `https://developer.android.com/reference/android/app/TaskInfo#taskId` The identifier for this task. |
| ` public https://developer.android.com/reference/android/content/ComponentName` | `https://developer.android.com/reference/android/app/TaskInfo#topActivity` The component of the top activity in the task, currently showing to the user. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/app/TaskInfo#getDisplayId()() ` |
| ` boolean` | ` https://developer.android.com/reference/android/app/TaskInfo#isVisible()() ` Whether this task is visible. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/TaskInfo#toString()() ` Returns a string representation of the object. |

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


## Fields

### baseActivity

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

```
public ComponentName baseActivity
```

The component of the first activity in the task, can be considered the "application" of this
task.

<br />

### baseIntent

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

```
public Intent baseIntent
```

The base intent of the task (generally the intent that launched the task). This intent can
be used to relaunch the task (if it is no longer running) or brought to the front if it is.

<br />

### isRunning

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

```
public boolean isRunning
```

Whether or not this task has any running activities.

<br />

### numActivities

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

```
public int numActivities
```

The number of activities in this task (including running).

<br />

### origActivity

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

```
public ComponentName origActivity
```

The component of the target activity if this task was started from an activity alias.
Otherwise, this is null.

<br />

### taskDescription

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

```
public ActivityManager.TaskDescription taskDescription
```

The recent activity values for the highest activity in the stack to have set the values.
`https://developer.android.com/reference/android/app/Activity#setTaskDescription(android.app.ActivityManager.TaskDescription)`.

<br />

### taskId

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

```
public int taskId
```

The identifier for this task.

<br />

### topActivity

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

```
public ComponentName topActivity
```

The component of the top activity in the task, currently showing to the user.

<br />

## Public methods

### getDisplayId

Added in [version 37.2](https://developer.android.com/topic/libraries/support-library/revisions)

```
public int getDisplayId ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | The id of the display this task is associated with. <br /> |

### isVisible

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

```
public boolean isVisible ()
```

Whether this task is visible.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### toString

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

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |