【问题标题】:How to make a list of recent/running apps如何列出最近/正在运行的应用程序
【发布时间】:2011-07-29 08:25:35
【问题描述】:

按住手机上的主页按钮时,会弹出一个弹出窗口,显示最近的应用程序。有谁知道如何通过代码执行相同的操作?我需要能够在列表视图中选择一个。

【问题讨论】:

标签: java android


【解决方案1】:

你需要使用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

【讨论】:

  • 谢谢似乎很直接
【解决方案2】:

getRunningAppProcesses() 听起来像是一种可以帮助您完成任何您想要完成的工作的方法。

【讨论】:

    【解决方案3】:

    同时查看getRecentTasks(int, int)
    这应该显示历史记录,无论应用程序是否仍在“运行”

    【讨论】:

      猜你喜欢
      • 2012-09-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多