question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Job cancels upon app exit or phone reboot

See original GitHub issue

I know someone has asked this before, but I still think it is a bug.

I want to run a Job once a day. The job includes the logic to do a query and then show a notification window to the user. I use the following in my presenter.

  new JobRequest.Builder(TAG)
     .setPeriodic(getReminderInterval())
     .setPersisted(true)
     .setUpdateCurrent(true)
     .setExtras(args)
     .build()
     .schedule();

I found that unless my app is running or in the background, the job gets cancelled, which is pretty likely. So the following scenarios causes the job to cancel:

1/ user swipe away the app in Recents 2/ user backgrounds the app and restarts the phone

What’s the proper way of using this library so that I can in fact execute some code on a daily basis as the FAQ suggest?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:17

github_iconTop GitHub Comments

1reaction
vRallevcommented, Oct 15, 2017

No, it’s decided at runtime.

1reaction
jemshitcommented, Oct 24, 2016

AlarmManager runs in background even app is killed from recent history.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to stop jobservice when the user exits/closes the app?
I am planning to do stop/cancel the job in onStop activity lifecycle method. But how do I make sure that the job is...
Read more >
Problem: Unable to cancel a job in ArcGIS Pro - Esri Support
Force closing ArcGIS Pro does not cancel the job as the sharing process restarts after reopening the application.
Read more >
Quit and reopen an app on iPhone - Apple Support
To reopen the app, go to the Home Screen (or App Library), then tap the app. If quitting and reopening the app doesn't...
Read more >
Pause, cancel, or exit a migration - Google Help
When you use the data migration service, you can pause, restart, cancel, or exit a migration. You must be signed in as a...
Read more >
Schedule tasks with WorkManager Part of Android Jetpack.
WorkManager is intended for work that is required to run reliably even if the user navigates off a screen, the app exits, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found