JobIntentService only brings IntentService to Android 8+, which is more strict regarding background services. It works like the old IntentService on devices with older versions of Android.
IntentService never intended to be canceled , so the absence of any API to cancel JobIntentService .
Therefore, JobIntenService should only be used for work that does not need to be undone. Please note: JobIntentService can still be used for work that may fail and therefore be interrupted.
Work that can be undone must be done either:
- An
Activity (or its ViewModel ) for short work - JobService (using Firebase Job Manager or Job Scheduler if minSdk is 21)
- User foreground mode
Louis CAD
source share