missing calendars/events when closing app while task is still running
forrestguice opened this issue · comments
Closing the app while adding calendars kills the running task. The result is calendars that are incomplete or missing. A progress dialog was added to prevent this from happening accidentally. A dialog is better than no feedback at all, but it doesn't actually prevent the problem.
To reproduce...
- Toggle calendars off
- Toggle calendars on
- Click Home (to browse away) -> Task List -> Clear
- Watch the notification tray. The progress notification will stay open indefinitely since the task responsible for managing it was killed (and therefore unable to dismiss it).
- Open the calendars app and inspect for missing events. Since the moon calendar is added first (and takes a pretty long time), its likely the solstice calendar is entirely missing.
Fixed by moving the task responsible for adding calendars into a bound service and changing the progress notification to use startForeground
(transition to foreground service).