System.out.print(info);
}
} 进程获取信息
@Override
public void onClick(View v) {
String info = "";
List<RunningAppProcessInfo> apps = am.getRunningAppProcesses();
for(RunningAppProcessInfo app:apps){
info = "进程信息开始:\n";
info += "当前进程的用户Id:" + app.uid + "\n";
info += "当前进程的名称:" + app.processName + "\n";
info += "当前进程Id:" + app.pid + "\n";
info += "进程在系统中的重要级别:" + app.importance + "\n";
info += "进程的重要原因代码:" + app.importanceReasonCode + "\n";
info += "进程中组件的描述信息:" + app.importanceReasonComponent + "\n";
info += "当前进程的子进程Id:" + app.importanceReasonPid + "\n";
info += "在同一个重要级别内的附加排序值:" + app.lru + "\n";
System.out.print(info);
}
}