/ Published in: Java
This functions checks if a service is running or not.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
ActivityManager activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE); for (RunningServiceInfo runningServiceInfo : activityManager.getRunningServices(Integer.MAX_VALUE)) { if (serviceName.equals(runningServiceInfo.service.getClassName())) { return true; } } return false; }