标签:
public static boolean isServiceRun(Context context,String serviceName){ ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<RunningServiceInfo> rsis = am.getRunningServices(300); for (RunningServiceInfo runningServiceInfo : rsis) { if(runningServiceInfo.service.getClassName().equals(serviceName)){ return true; } } return false; }
标签:
原文地址:http://www.cnblogs.com/cbooy/p/4741031.html