同样需要用到ActivityManager。例如:
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { if ("com.XXX.AutoCheckService".equals(service.service.getClassName())) { isServiceRunning = true; } }