How is JobIntentService related to JobService?

前端 未结 3 2004
我寻月下人不归
我寻月下人不归 2021-02-12 11:36

In case of Service and IntentService the main differences are Service runs on the main thread while IntentService is not, and

3条回答
  •  终归单人心
    2021-02-12 12:13

    JobIntentService is essentially a replacement for IntentService, offering similar semantics in a way that "plays nice" with Android O's new background execution restrictions. It is implemented as a scheduled job on O+, but that's abstracted away -- your app doesn't need to care that it's a job.

    Never schedule() a job directly that you expect to use via the JobIntentService support class. JobIntentService uses the enqueue() system in the job scheduler, and you cannot mix and match enqueue() and schedule() for the same job.

提交回复
热议问题