Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cancel a JobIntentService

Tags:

People also ask

How do I stop JobIntentService?

IntentService has never been designed to be cancelled, hence the lack of any API to cancel a JobIntentService . Therefore, JobIntenService should only be used for work that don't need to be cancelled. Note that JobIntentService can still be used for work that can fail, and consequently, be aborted.

Is JobIntentService deprecated?

This class is deprecated. This class has been deprecated in favor of the Android Jetpack WorkManagerlibrary, which makes it easy to schedule deferrable, asynchronous tasks that are expected to run even if the app exits or the device restarts.

What is JobIntentService in Android?

You can say JobIntentService is a modern way to run the background service from the background application. JobIntentService. JobIntentService works in the same way as a Service however it enqueues the work into the JobScheduler on compatible Android targets( SDK 26 or more).


How can I cancel a JobIntentService? I see no methods to do so in the docs, apart maybe from the JobSheduler API and the Context#stopService(...) method, which I'm unsure if it's the right way.