gpt4 book ai didi

java - 如何列出最近/正在运行的应用程序

转载 作者:太空宇宙 更新时间:2023-11-03 12:41:43 25 4
gpt4 key购买 nike

按住手机上的主页按钮时,会出现一个弹出窗口,显示最近的应用程序。有谁知道如何通过代码执行相同的操作?我需要能够在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com