Skip to content

Instantly share code, notes, and snippets.

@ishitcno1
Last active December 27, 2015 03:49
Show Gist options
  • Save ishitcno1/7262044 to your computer and use it in GitHub Desktop.
Save ishitcno1/7262044 to your computer and use it in GitHub Desktop.
private boolean isMyServiceRunning() {
ActivityManager activityManager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);
for (ActivityManager.RunningServiceInfo serviceInfo: activityManager.getRunningServices(Integer.MAX_VALUE)) {
if (ShakeLockService.class.getName().equals(serviceInfo.service.getClassName())) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment