Android examples for Android OS:Process
get running processes
//package com.java2s; import java.util.List; import android.app.ActivityManager; import android.app.ActivityManager.RunningAppProcessInfo; import android.content.Context; public class Main { private static ActivityManager am = null; /**/*from ww w. j a v a2 s . c om*/ * get running processes * @return list of running process */ public static List<RunningAppProcessInfo> getRunningProcesses( Context context) { if (am == null) { am = (ActivityManager) context .getSystemService(Context.ACTIVITY_SERVICE); } return am.getRunningAppProcesses(); } }