Skip to content

Instantly share code, notes, and snippets.

@asanand3
Last active December 24, 2015 07:26
Show Gist options
  • Save asanand3/f03495efbbf7a5744774 to your computer and use it in GitHub Desktop.
Save asanand3/f03495efbbf7a5744774 to your computer and use it in GitHub Desktop.
private boolean isServiceRunning() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
if ("net.anandsingh.services.RefreshTokenService".equals(service.service.getClassName())) {
return true;
}
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment