public static class ActivityManager.AppTask extends Object
ActivityManager.getAppTasks()
Constructor and Description |
---|
AppTask(IAppTask task) |
Modifier and Type | Method and Description |
---|---|
void |
finishAndRemoveTask()
Finishes all activities in this task and removes it from the recent tasks list.
|
ActivityManager.RecentTaskInfo |
getTaskInfo()
Get the RecentTaskInfo associated with this task.
|
void |
moveToFront()
Bring this task to the foreground.
|
void |
setExcludeFromRecents(boolean exclude)
Modify the
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS flag in the root
Intent of this AppTask. |
void |
startActivity(Context context,
Intent intent,
Bundle options)
Start an activity in this task.
|
public void finishAndRemoveTask()
public ActivityManager.RecentTaskInfo getTaskInfo()
public void moveToFront()
public void startActivity(Context context, Intent intent, Bundle options)
Intent.FLAG_ACTIVITY_NEW_TASK
or would otherwise be launched in to a new task, then the activity not launched but
this task be brought to the foreground and a new intent delivered to the top
activity if appropriate.
In other words, you generally want to use an Intent here that does not specify
Intent.FLAG_ACTIVITY_NEW_TASK
or Intent.FLAG_ACTIVITY_NEW_DOCUMENT
,
and let the system do the right thing.
intent
- The Intent describing the new activity to be launched on the task.options
- Optional launch options.Activity.startActivity(android.content.Intent, android.os.Bundle)
public void setExcludeFromRecents(boolean exclude)
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
flag in the root
Intent of this AppTask.exclude
- If true, Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
will
be set; otherwise, it will be cleared.