Hie!
We have a job which was configured in the previous version of the app to run periodically once a day to sync data from our server.
We no longer need to sync the said data. Can we just delete the Job class and remove it from the JobCreator? Or some other steps are required?
-Thanks.
No, that's not enough for periodic jobs. You need to cancel the job on all devices, otherwise the system still tries to execute your job. Because your job creator doesn't return a job, it'll stop executing the job for this interval, but it'll try again the next day in your case.
Simply call JobManager.instance().cancelAllForTag("Job-Tag"); and you should be good.
Does this help?
Thanks a lot for the info.. Was this a part of the FAQ and I missed it?
Will be closing the issue.
@vRallev Thanks. We should really have "How to cancel job" info in FAQ.
It's at the front page: https://github.com/evernote/android-job#advanced
@vRallev How to get Job information like when it's scheduled?
Like :
Set<Job> jobs = JobManager.instance().getAllJobsForTag(Tasker.TAG);
for (Job job : jobs) {
String time = job.getScheduledTime();
}
Most helpful comment
No, that's not enough for periodic jobs. You need to cancel the job on all devices, otherwise the system still tries to execute your job. Because your job creator doesn't return a job, it'll stop executing the job for this interval, but it'll try again the next day in your case.
Simply call
JobManager.instance().cancelAllForTag("Job-Tag");and you should be good.Does this help?