【发布时间】:2011-07-29 08:25:35
【问题描述】:
按住手机上的主页按钮时,会弹出一个弹出窗口,显示最近的应用程序。有谁知道如何通过代码执行相同的操作?我需要能够在列表视图中选择一个。
【问题讨论】:
按住手机上的主页按钮时,会弹出一个弹出窗口,显示最近的应用程序。有谁知道如何通过代码执行相同的操作?我需要能够在列表视图中选择一个。
【问题讨论】:
你需要使用getRunningTasks
来自文档:
public List<ActivityManager.RunningTaskInfo> getRunningTasks (int maxNum)
Return a list of the tasks that are currently running, with the most recent being first and older ones after in order
【讨论】:
getRunningAppProcesses() 听起来像是一种可以帮助您完成任何您想要完成的工作的方法。
【讨论】:
同时查看getRecentTasks(int, int)。
这应该显示历史记录,无论应用程序是否仍在“运行”
【讨论】: