Fix issue #560 - Background process not stopped on some devices

This commit is contained in:
stom79 2018-11-09 19:05:16 +01:00
parent d890c56191
commit 5d7f69aa24
1 changed files with 5 additions and 1 deletions

View File

@ -34,6 +34,7 @@ import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.engine.GlideException;
@ -131,7 +132,10 @@ public class LiveNotificationService extends Service implements NetworkStateRece
if( intent == null || intent.getBooleanExtra("stop", false) ) {
stopSelf();
}
return START_STICKY;
if( backgroundProcess)
return START_STICKY;
else
return START_NOT_STICKY;
}
@Override