![](/img/trans.png)
[英]How to count the number of applications running in background in Android?
[英]How to know how many applications are running in the background in android?
我可以在后台运行应用程序,但我想知道有多少应用程序在后台运行。 与按下中心按钮时的某些移动设备一样,会显示当前正在运行的应用程序列表。
这在Android中是否可行? 如果可能的话,然后给出一些代码片段和步骤来实现这一目标。
Dev Tools应用程序 (安装在模拟器中)通过获取ActivityManager
的实例显示正在运行的进程列表:
ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> l = am.getRunningAppProcesses();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.