简体   繁体   中英

How to know how many applications are running in the background in android?

I can run an application in background but I want to know how many applications are running in the background. Like in some mobile while pressing the center button a list of currently running applications are displayed.

Is this is possible in android? If possible then give some code snippets and steps to achieve this.

The Dev Tools application (installed in emulators) shows a list of running processes by obtaining an instance of ActivityManager :

ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> l = am.getRunningAppProcesses();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM