Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

ActivityManager.RecentTaskInfo

public static class ActivityManager.RecentTaskInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.ActivityManager.RecentTaskInfo


Information you can retrieve about tasks that the user has most recently started or visited.

Summary

Inherited constants

Fields

public static final Creator<ActivityManager.RecentTaskInfo> CREATOR

public int affiliatedTaskId

Task affiliation for grouping with other tasks.

public ComponentName baseActivity

The component launched as the first activity in the task.

public Intent baseIntent

The original Intent used to launch the task.

public CharSequence description

Description of the task's last state.

public int id

If this task is currently running, this is the identifier for it.

public int numActivities

Number of activities in this task.

public ComponentName origActivity

If this task was started from an alias, this is the actual activity component that was initially started; the component of the baseIntent in this case is the name of the actual activity implementation that the alias referred to.

public int persistentId

The true identifier of this task, valid even if it is not running.

public ActivityManager.TaskDescription taskDescription

The recent activity values for the highest activity in the stack to have set the values.

public ComponentName topActivity

The activity component at the top of the history stack of the task.

Public constructors

ActivityManager.RecentTaskInfo()

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

void readFromParcel(Parcel source)
void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

Fields

CREATOR

added in API level 1
public static final Creator<ActivityManager.RecentTaskInfo> CREATOR

affiliatedTaskId

added in API level 21
public int affiliatedTaskId

Task affiliation for grouping with other tasks.

baseActivity

added in API level 23
public ComponentName baseActivity

The component launched as the first activity in the task. This can be considered the "application" of this task.

baseIntent

added in API level 1
public Intent baseIntent

The original Intent used to launch the task. You can use this Intent to re-launch the task (if it is no longer running) or bring the current task to the front.

description

added in API level 11
public CharSequence description

Description of the task's last state.

id

added in API level 1
public int id

If this task is currently running, this is the identifier for it. If it is not running, this will be -1.

numActivities

added in API level 23
public int numActivities

Number of activities in this task.

origActivity

added in API level 1
public ComponentName origActivity

If this task was started from an alias, this is the actual activity component that was initially started; the component of the baseIntent in this case is the name of the actual activity implementation that the alias referred to. Otherwise, this is null.

persistentId

added in API level 12
public int persistentId

The true identifier of this task, valid even if it is not running.

taskDescription

added in API level 21
public ActivityManager.TaskDescription taskDescription

The recent activity values for the highest activity in the stack to have set the values. Activity.setTaskDescription(android.app.ActivityManager.TaskDescription).

topActivity

added in API level 23
public ComponentName topActivity

The activity component at the top of the history stack of the task. This is what the user is currently doing.

Public constructors

ActivityManager.RecentTaskInfo

added in API level 1
public ActivityManager.RecentTaskInfo ()

Public methods

describeContents

added in API level 1
public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

readFromParcel

added in API level 1
public void readFromParcel (Parcel source)

Parameters
source Parcel

writeToParcel

added in API level 1
public void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.

flags int: Additional flags about how the object should be written. May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE.