Skip to content

Instantly share code, notes, and snippets.

View theshethmilan's full-sized avatar
💭
Let go of the past, It's time to focus on what's ahead and what's possible.

Milan Sheth theshethmilan

💭
Let go of the past, It's time to focus on what's ahead and what's possible.
View GitHub Profile
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;
}