ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List runningAppProcessInfo = am.getRunningAppProcesses();
for (int i = 0; i < 10 /*runningAppProcessInfo.size()*/; i++) {
Log.i("process"," process number "+i +" name "+runningAppProcessInfo.get(i).processName);
}