1

So I am working on removing all background tasks started via JobDispatcher and replacing them with WorkManager. I have most of the work done, but I am curious on how to cancel a job that was set to be recurring with lifetime set to FOREVER.

When refactoring, I removed all references to the old job scheduled by JobDispatcher, but I was noticing an error saying Unable to bind to MyJobService when testing the upgrade path from the version that used JobDispatcher and my new WorkManager version. I am guessing that the old job is just running forever, is this the case? Does the job automatically cancel or will I need to manually stop the job before starting the new background worker using WorkManager?

Citut
  • 847
  • 2
  • 10
  • 25
  • It will be lost on a device reboot. I would not worry about it. – Yavor Mitev Oct 06 '21 at 13:32
  • @YavorMitev Are there docs/examples of this somewhere? The documentation when setting `Lifetime.FOREVER` states that the job will persist, even across device reboots. – Citut Oct 06 '21 at 16:50

0 Answers0