I'm trying to list all the currently running processes using the below code:
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> processInfo = am.getRunningAppProcesses();
for (int i = 0; i < processInfo.size(); i++) {
Log.d("Process: ",""+processInfo.get(i).processName );
}
It is listing everything except the root processes like 'sh', 'strace' e.t.c.. can anyone tell how to list these also? They are being listed when executing 'ps' command via shell command prompt..