Android how to check if the intent service is still running or has stopped running Android how to check if the intent service is still running or has stopped running android android

Android how to check if the intent service is still running or has stopped running


Try this may be useful for u

private boolean isMyServiceRunning() {    ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);    for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {        if ("com.example.MyService".equals(service.service.getClassName())) {            return true;        }    }    return false;}