simpletask-android
simpletask-android copied to clipboard
Fix bug where notifications can disappear/lose association with task
Since adding the ability to pin tasks as notifications in #1170 I've found a couple issues with the current implementation. Namely:
- Sometimes pinned notifications will randomly disappear. It seems like this was caused by the app being restarted by the OS/crashing in the background as I could reproduce in an emulator by running
adb shell am force-stop nl.mpcjanssen.simpletask.debug.
Solution: Create the notifications from a Service and call startForeground.
- If the todo list is modified outside of simpletask, the task IDs will change causing the notifications to lose their association with each task.
Solution: Make the task IDs persistent by storing them in SharedPreferences.
@camgraff, thank you for this PR. It does seem to have quite a few moving parts so I would like to review it or at least understand it in a bit more detail. Unfortunately I do not have time for that right now so it's going to take some time for this to be merged.