Android JobService:
https://www.jianshu.com/p/aba38b9e11e7
JobScheduler的使用
https://www.jianshu.com/p/28b13686b2b8
https://www.jianshu.com/p/aa957774a965
(1) 创建 JobScheduler
JobScheduler mJobScheduler = (JobScheduler) Context.getSystemService(Context.JOB_SCHEDULER_SERVICE).
(2)创建 JobInfo.Builder
JobInfo.BuildermBuilder=newJobInfo.Builder(id,newComponentName(this,MyJobService.class));
(3)获取JobInfo
JobInfo jobInfo = builder.build();
(4)开始调度
mJobScheduler.scheduler(jobInfo );
JobScheduler works with a minimum periodic of 15 mins.
网友评论