Android获取系统运行的服务
public class ServiceRunningUtil { public static boolean isRunning(Context context,String className){ ActivityManager manager = (ActivityManager) context.getSystemService(Activity.ACTIVITY_SERVICE); List<RunningServiceInfo> services = manager.getRunningServices(100); for(RunningServiceInfo info : services){ if(className.equals(info.service.getClassName())){ return true; } } return false; } }