Stay organized with collections
Save and categorize content based on your preferences.
TaskInfo
open class TaskInfo
Stores information about a particular Task.
Summary
Public methods |
open Boolean |
Whether this task is visible.
|
open String |
|
Properties |
ComponentName? |
The component of the first activity in the task, can be considered the "application" of this task.
|
Intent |
The base intent of the task (generally the intent that launched the task).
|
Boolean |
Whether or not this task has any running activities.
|
Int |
The number of activities in this task (including running).
|
ComponentName? |
The component of the target activity if this task was started from an activity alias.
|
ActivityManager.TaskDescription? |
The recent activity values for the highest activity in the stack to have set the values.
|
Int |
The identifier for this task.
|
ComponentName? |
The component of the top activity in the task, currently showing to the user.
|
Public methods
isVisible
open fun isVisible(): Boolean
Whether this task is visible.
toString
open fun toString(): String
Return |
String |
a string representation of the object. |
Properties
baseActivity
var baseActivity: ComponentName?
The component of the first activity in the task, can be considered the "application" of this task.
baseIntent
var baseIntent: Intent
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.
isRunning
var isRunning: Boolean
Whether or not this task has any running activities.
numActivities
var numActivities: Int
The number of activities in this task (including running).
origActivity
var origActivity: ComponentName?
The component of the target activity if this task was started from an activity alias. Otherwise, this is null.
taskId
var taskId: Int
The identifier for this task.
topActivity
var topActivity: ComponentName?
The component of the top activity in the task, currently showing to the user.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TaskInfo\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nTaskInfo\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/TaskInfo \"View this page in Java\") \n\n```\nopen class TaskInfo\n```\n\n|---|---------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.TaskInfo](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [ActivityManager.RecentTaskInfo](/reference/kotlin/android/app/ActivityManager.RecentTaskInfo), [ActivityManager.RunningTaskInfo](/reference/kotlin/android/app/ActivityManager.RunningTaskInfo) |--------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------| | [ActivityManager.RecentTaskInfo](/reference/kotlin/android/app/ActivityManager.RecentTaskInfo) | Information you can retrieve about tasks that the user has most recently started or visited. | | [ActivityManager.RunningTaskInfo](/reference/kotlin/android/app/ActivityManager.RunningTaskInfo) | Information you can retrieve about a particular task that is currently \"running\" in the system. | |\n\nStores information about a particular Task.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------|\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isVisible](#isVisible())`()` Whether this task is visible. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\n| Properties ||\n|---------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ComponentName](../content/ComponentName.html#)? | [baseActivity](#baseActivity:android.content.ComponentName) The component of the first activity in the task, can be considered the \"application\" of this task. |\n| [Intent](../content/Intent.html#) | [baseIntent](#baseIntent:android.content.Intent) The base intent of the task (generally the intent that launched the task). |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isRunning](#isRunning:kotlin.Boolean) Whether or not this task has any running activities. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [numActivities](#numActivities:kotlin.Int) The number of activities in this task (including running). |\n| [ComponentName](../content/ComponentName.html#)? | [origActivity](#origActivity:android.content.ComponentName) The component of the target activity if this task was started from an activity alias. |\n| [ActivityManager.TaskDescription](/reference/kotlin/android/app/ActivityManager.TaskDescription)? | [taskDescription](#taskDescription:android.app.ActivityManager.TaskDescription) The recent activity values for the highest activity in the stack to have set the values. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [taskId](#taskId:kotlin.Int) The identifier for this task. |\n| [ComponentName](../content/ComponentName.html#)? | [topActivity](#topActivity:android.content.ComponentName) The component of the top activity in the task, currently showing to the user. |\n\nPublic methods\n--------------\n\n### isVisible\n\nAdded in [API level 32](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun isVisible(): Boolean\n```\n\nWhether this task is visible. \n\n### toString\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |\n\nProperties\n----------\n\n### baseActivity\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar baseActivity: ComponentName?\n```\n\nThe component of the first activity in the task, can be considered the \"application\" of this task. \n\n### baseIntent\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar baseIntent: Intent\n```\n\nThe 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. \n\n### isRunning\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar isRunning: Boolean\n```\n\nWhether or not this task has any running activities. \n\n### numActivities\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar numActivities: Int\n```\n\nThe number of activities in this task (including running). \n\n### origActivity\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar origActivity: ComponentName?\n```\n\nThe component of the target activity if this task was started from an activity alias. Otherwise, this is null. \n\n### taskDescription\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar taskDescription: ActivityManager.TaskDescription?\n```\n\nThe recent activity values for the highest activity in the stack to have set the values. [Activity.setTaskDescription(android.app.ActivityManager.TaskDescription)](/reference/kotlin/android/app/Activity#setTaskDescription(android.app.ActivityManager.TaskDescription)). \n\n### taskId\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar taskId: Int\n```\n\nThe identifier for this task. \n\n### topActivity\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nvar topActivity: ComponentName?\n```\n\nThe component of the top activity in the task, currently showing to the user."]]