RunningTaskInfo info = manager.getRunningTasks(1).get(0); //获得信息
String shortClassName = info.topActivity.getShortClassName(); //类名
String className = info.topActivity.getClassName(); //完整类名
String packageName = info.topActivity.getPackageName(); //包名
/**
* 判断进程是否运行
* @return
*/
public static boolean isProessRunning(Context context, String proessName) {
boolean isRunning = false;
ActivityManager am = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> lists = am.getRunningAppProcesses();
for (RunningAppProcessInfo info : lists) {
if (info.processName.equals(proessName)) {
isRunning = true;
}
}
return isRunning;
}