小编tac*_*urv的帖子

JobScheduler和JobIntentService

我正在开发支持Android API 21及更高版本的应用.我的大多数后台任务都是使用API​​ 21中引入的JobScheduler设计的.

我最近遇到了API 26中引入的JobIntentService.该文档说"在Android O或更高版本上运行时,工作将通过JobScheduler.enqueue作为作业调度.当在旧版本的平台上运行时,它将使用Context. startService".

我想要理解的是,为什么android只使用API​​ 26而不是API 21使用JoScheduler.API 26及以上的JobScheduler是否与API 21中引入的不同.我是否需要更改任何代码为了提高效率/避免错误,将后台作业转换为使用JobIntentService而不是Job Scheduler.我想我不明白JobIntentService试图实现的目的.

android android-jobscheduler

5
推荐指数
1
解决办法
3227
查看次数

标签 统计

android ×1

android-jobscheduler ×1