On application launch, app starts the service that should to do some network task. After targeting API level 26, my application fails to start service on Android 8.0 on back
If the service is running in a background thread by extending IntentService
, you can replace IntentService
with JobIntentService
which is provided as part of Android Support Library
The advantage of using JobIntentService
is, it behaves as an IntentService
on pre-O devices and on O and higher, it dispatches it as a job
JobScheduler
can also be used for periodic/on demand jobs. But, ensure to handle backward compatibility as JobScheduler
API is available only from API 21