List<ActivityManager.RunningAppProcessInfo> listOfProcesses = mActivityManager.getRunningAppProcesses();
for (ActivityManager.RunningAppProcessInfo process : listOfProcesses) {
Log.e("Process Running", process.processName);
if (process.processName.contains("com.cc.op")) {
//todo
break;
}
}
以上代码可以判断你的进程是否在运行