按住手机上的主页按钮时,会出现一个弹出窗口,显示最近的应用程序。有谁知道如何通过代码执行相同的操作?我需要能够在 ListView 中选择一个。
最佳答案
您需要使用 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
关于java - 如何列出最近/正在运行的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6870487/