美文网首页
Android JobService

Android JobService

作者: fsdffdaga | 来源:发表于2019-11-08 23:42 被阅读0次

    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.

    相关文章

      网友评论

          本文标题:Android JobService

          本文链接:https://www.haomeiwen.com/subject/xplgbctx.html