What happens if I schedule the same periodic job (same job ID) and the Job has already been scheduled? Does it start its period again from the beginning?
For example, I call this method twice:
JobInfo myLongJob = new JobInfo.Builder(
JOB_ID,
new ComponentName(context, JobSchedulerLongService.class.getName())
).setPeriodic(10000)
.build();
jobScheduler.schedule(myLongJob);
Does scheduling the job second time cause the periodic timer to start counting again?
I found it after doing some tests:
Does scheduling the job the second time cause the periodic timer to start counting again?
Yes! and...
It will depend on:
Added really useful comment from @Gauthier:
jobId - int: Application-provided id for this job. Subsequent calls to cancel, or jobs created with the same jobId, will update the pre-existing job with the same id. [link to this doc](http://developer.android.com/reference/android/app/job/JobInfo.Builder.html#JobInfo.Builder(int, android.content.ComponentName))