android evernote透析作业计划为定期

时间:2018-11-02 06:12:09

标签: android evernote android-jobscheduler

我用evernote创建了DailySyncJobSchedular

  public static void schedule() {
    Log.i(TAG, "schedule: ");
    if (!JobManager.instance().getAllJobRequestsForTag(TAG).isEmpty()) {
        return;
    }
    JobRequest.Builder builder = new JobRequest.Builder(TAG));
    DailyJob.schedule(builder, TimeUnit.HOURS.toMillis(9), TimeUnit.HOURS.toMillis(18));
}

并调用MainActivity> DemoSyncJob.schedule();

我可以在印度时间上午9点至下午6点之间每30分钟执行一次此拨号作业吗? 我修改了我的代码,例如

JobRequest.Builder builder = new JobRequest.Builder(TAG).setPeriodic(TimeUnit.MINUTES.toMillis(30), TimeUnit.MINUTES.toMillis(5));
    DailyJob.schedule(builder, TimeUnit.HOURS.toMillis(9), TimeUnit.HOURS.toMillis(18));

这正确吗?

0 个答案:

没有答案