tags:

views:

488

answers:

1

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 means give some code snippets and steps to achieve this.

+3  A: 

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();
Josef
And how to find Linux kernel related process? getRunningProcesses() only get those Apps running on android framework.
XC
you can run `ps`, just like on any other linux system
Josef