我正在尝试将JobService
与JobInfo
一起安排。我希望它每12小时定期运行一次。以下是我的代码。
JobInfo purgingServiceJob = new JobInfo.Builder(SERVICE_JOB_ID,
new ComponentName(this, PurgingService.class))
.setRequiresCharging(false)
.setPeriodic(12*60*60*1000) //Millis for 12 hours
.setPersisted(true)
.build();
但是此作业每12分钟运行一次。
setPeriodic
毫秒有最大限制吗?也许我在这里犯了某种错误。任何帮助将不胜感激。