Gives list of currently running process,
ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> list= am.getRunningAppProcesses();
for(int i =0 ; i< list.size();i++)
{
ActivityManager.RunningAppProcessInfo runningApp = list.get(i);
processInfo.setProcessName(runningApp.processName);
int processId = runningApp.pid;
processInfo.setProcessId(processId);
runningPL.add(processInfo);
List<ActivityManager.RunningAppProcessInfo> list= am.getRunningAppProcesses();
for(int i =0 ; i< list.size();i++)
{
ActivityManager.RunningAppProcessInfo runningApp = list.get(i);
processInfo.setProcessName(runningApp.processName);
int processId = runningApp.pid;
processInfo.setProcessId(processId);
runningPL.add(processInfo);
}
No comments:
Post a Comment