private boolean isServiceStart() { ActivityManager myManager = (ActivityManager) getApplicationContext() .getSystemService(Context.ACTIVITY_SERVICE); ArrayList<RunningServiceInfo> runningService = (ArrayList<RunningServiceInfo>) myManager .getRunningServices(30); for (int i = 0; i < runningService.size(); i++) { if (runningService.get(i).service.getClassName().toString() .equals("com.**.**.YourService")) { return true; } } return false; }
原文地址:http://blog.csdn.net/vvcumt/article/details/39135829