Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thomasbabuj/f3ca9dc565d626eb50287c3efa44667b to your computer and use it in GitHub Desktop.
Save thomasbabuj/f3ca9dc565d626eb50287c3efa44667b 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("com.example.MyNeatoIntentService".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