标签:style blog color cti for 管理
1 public static boolean isServiceRunning(Context context, String serviceName) { 2 // 得到一个应用管理器, 如同windows中的任务管理器一样 3 ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); 4 List<RunningServiceInfo> services = am.getRunningServices(100); 5 for (RunningServiceInfo sInfo : services) { 6 String runningServiceName = sInfo.service.getClassName(); 7 if(serviceName.equals(runningServiceName)){ 8 return true; 9 } 10 } 11 return false; 12 }
标签:style blog color cti for 管理
原文地址:http://www.cnblogs.com/gaoxiaoyuan/p/3833236.html