27 Haziran 2018 Çarşamba

JobScheduler Sınıfı

constructor
Şöyle yaparız.
JobScheduler scheduler = (JobScheduler) context.getSystemService
  (Context.JOB_SCHEDULER_SERVICE);
schedule metodu
Açıklaması şöyle.
Minimum duration between two schedule is around 15 minutes. You can easily query for this information using getMinPeriodMillis()
Açıklaması şöyle.
Note:
Attempting to declare a smaller period that this when scheduling a job will result in a job that is still periodic, but will run with this effective period.
Örnek
Şöyle yaparız.
jobScheduler.schedule(new JobInfo.Builder(MY_JOB_ID,
                new ComponentName(applicationContext, MyJob.class))
                .setPeriodic(syncInterval)
                .build());
Örnek
Şöyle yaparız.
JobScheduler scheduler = ...;

JobInfo job = new JobInfo.Builder(1, new ComponentName(context, MySchedulerService.class))
  .setMinimumLatency(...)
  .build();

scheduler.schedule(job);

Hiç yorum yok:

Yorum Gönder