public boolean checkIsService(String className){
boolean isit = false;
ActivityManager am = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningServiceInfo> list = am.getRunningServices(Integer.MAX_VALUE);
if(list.size()<=0){
return false;
}
for(int i = 0;i<list.size();i++){
if(list.get(i).service.getClassName().equals(className)==true){
isit = true;
break;
}
}
return isit;
}
获取className
XXX.class.getname();