Added in API level 1

RecentTaskInfo


open class RecentTaskInfo : TaskInfo, Parcelable

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

Summary

Inherited constants
Int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

Int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel: 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.

Public constructors

Public methods
open Int

open Unit

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

Inherited functions
Boolean isVisible()

Whether this task is visible.

String toString()

Properties
static Parcelable.Creator<ActivityManager.RecentTaskInfo!>

Int

Task affiliation for grouping with other tasks.

CharSequence!

Description of the task's last state.

Int

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

Int

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

Inherited properties
ComponentName? baseActivity

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

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.

Boolean isRunning

Whether or not this task has any running activities.

Int numActivities

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

ComponentName? origActivity

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

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

Int taskId

The identifier for this task.

ComponentName? topActivity

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

Public constructors

RecentTaskInfo

Added in API level 1
RecentTaskInfo()

Public methods

describeContents

Added in API level 1
open fun describeContents(): Int
Return
Int 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

readFromParcel

Added in API level 1
open fun readFromParcel(source: Parcel!): Unit

writeToParcel

Added in API level 1
open fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit
Parameters
dest Parcel: The Parcel in which the object should be written. This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 1
static val CREATOR: Parcelable.Creator<ActivityManager.RecentTaskInfo!>

affiliatedTaskId

Added in API level 21
Deprecated in API level 29
var affiliatedTaskId: Int

Deprecated: As of android.os.Build.VERSION_CODES#Q, currently always 0.

Task affiliation for grouping with other tasks.

description

Added in API level 11
Deprecated in API level 29
var description: CharSequence!

Deprecated: As of android.os.Build.VERSION_CODES#Q, currently always null.

Description of the task's last state.

id

Added in API level 1
Deprecated in API level 29
var id: Int

Deprecated: As of android.os.Build.VERSION_CODES#Q, use RecentTaskInfo.taskId to get the task id and RecentTaskInfo.isRunning to determine if it is running.

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

persistentId

Added in API level 12
Deprecated in API level 29
var persistentId: Int

Deprecated: As of android.os.Build.VERSION_CODES#Q, use RecentTaskInfo.taskId.

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

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Dec 18, 2024

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Dec 18, 2024

Connectivity describes how Android apps connect to and use network connections, including WiFi and Bluetooth.

Updated Sep 8, 2023