private boolean isServiceRunning() { ActivityManager manager = (ActivityManager)getSystemService(ACTIVITY_SERVICE); for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) { if (“your.servicename”.equals(service.service.getClassName())) { return true; } } return false; }
Thanks for this quick function :)
ReplyDeleteOn behalf of all lazy programmers ... thank you very much XD
ReplyDeleteDoes not work on Android KitKat
ReplyDeletegrazie
ReplyDeletecan you explain the code . . . .. ?
ReplyDelete