private boolean isMyServiceRunning() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if ("com.test.DataService".equals(service.service.getClassName())) {
return true;
}
}
return false;
}
No comments:
Post a Comment