Skip to content

Instantly share code, notes, and snippets.

View Deepak13245's full-sized avatar
🎯
Focusing

Deepak Kumar Deepak13245

🎯
Focusing
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;
}