![](/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.