08-12-2020 07:00
08-12-2020 07:00
Hey everyone,
I am developing a clock face from where the user can start a preset timer and once the timer is elapsed, the watch will vibrate and notify that the timer is elapsed.
Here is the problem, it works fine until I open another application or if I open the "Today" stats by swiping up, the timer resets and starts again.
Example: If the time is for 10 minutes, its started and is counting down, and before this gets elapsed I open an app or the today stats, then when I get back to the clock face, the timer forgets its previous state and starts afresh again!!!
Please help me out.. what am I missing here?
08-12-2020 13:16
08-12-2020 13:16
You need to save the state of your app to the file system when (or before) it exits. When it restarts, reload its state from the file system (if it was stored).
Be aware that the timer won't go off when your app isn't running.