private boolean isMyServiceRunning(Class<?> serviceClass) {
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if (serviceClass.getName().equals(service.service.getClassName())) {
return true;
}
}
return false;
}
Created
February 20, 2017 08:42
-
-
Save ixqbar/301e21f6ba5da3ed87194e211d4a8272 to your computer and use it in GitHub Desktop.
Android
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment