JobScheduler not repeating job

前端 未结 1 1502
余生分开走
余生分开走 2021-01-05 07:38

I\'m using a JobScheduler.setPeriodic() to repeat my JobIntentService. It works the first time but never repeats. Running on Android 7.0

ConcurrentCheck.java

相关标签:
1条回答
  • 2021-01-05 08:09

    The minimum period a job can be scheduled is 15 minutes. If it is set to a value less than 15 minutes, the job will use 15 minutes.

    See: MIN_PERIOD_MILLIS in JobInfo.

    Also, see this comment in the code too:

    Query the minimum interval allowed for periodic scheduled jobs. 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. A recurring task with your interval will need some other service, possibly the Alarm Manager will work for you.

    0 讨论(0)
提交回复
热议问题