I have an app with dynamic Card views. And it is behaving strangely. It has a timer, which seems to work even in the background (even when the screen is off), but at a much slower rate. But comparing the state of the timer before minimizing (and offing the screen) and after reopening, I can confirm that the timer still sort of runs in the background but much slower. How do I fix this?
Also, after minimizing the app and it would work for around 30 minutes (timer runs slowly), but if I open it about 2 hours later, it seems like the app is completely reset, all my dynamic card views are gone! How do I prevent this from happening? This is also a pain since I have timer that needs to run in the cards.
I see, is there no way around that? Dynamic cards are not meant to be permanent then? Can using a database prevent the app reset or automatically restore my dynamic cards when I reopen the app? And can I make the timer in the dynamic cards run again from where it left off? I am a complete newbie, sorry if my questions sound stupid.
Sorry I didn’t explain clearly. And I am not very good with English either. Timer runs slowly means that it runs slower than system clock. When you compare 10 seconds on the timer and 10 seconds on the clock, you will find that the timer’s 10 seconds last longer compared to 10 seconds on the clock. So, the timer ticks are lagging behind the clock ticks.
I didn’t post blocks because, maybe due to my non-existent programming skills, the blocks are all over the place and the program more than fills my entire screen, when I try to make the letters visible. And I thought there could be a more general answer to the problems. But I guess I could be wrong. And I will check out the app resume blocks, as you suggested. Thank you.
Is there anyway I can prevent the eventual reset of the app in the background and retain my created dynamic card views? Or does this deserve a new topic?