可能重复:
How to get the list of running applications?如何获取Android中活动应用程序的列表?
如何获得在活跃的Android应用程序的列表? 感谢您的回答。
可能重复:
How to get the list of running applications?如何获取Android中活动应用程序的列表?
如何获得在活跃的Android应用程序的列表? 感谢您的回答。
ActivityManager manager = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
List<RunningAppProcessInfo> processes = manager.getRunningAppProcesses();
然后你的RunningAppProcessInfo个集合,你可能想寻找在this
所以我得到所有正在运行的应用程序。我只需要活跃! –
这可能是对事情如何工作的误解。你如何定义一个“主动”过程? –
这个应用程序如何确定这一点? [Active Apps Ads](https://play.google.com/store/apps/details?id=com.elnware.ActiveAppsAds&feature=search_result) –
尝试复制你的问题,然后将其粘贴在谷歌搜索框,你会发现这是一个DUP问题:http://stackoverflow.com/questions/3304685/how-to-get-the-list-of-running-applications – wtsang02