private boolean isMyServiceRunning(Class<?> serviceClass) {
    ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
    for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
        if (serviceClass.getName().equals(service.service.getClassName())) {
            return true;
        }
    }
    return false;
}

 

https://stackoverflow.com/questions/17588910/check-if-service-is-running-on-android

Fully customizable WordPress Multi-Purpose theme for any kind of business, blog, magazine, real estate agencies or portals and more.