I figured out the sorting problem when times are passed to the History activity, so now that's working just fine (including passing the hints used flag).
Now, the actual timer itself..... Android apps are paused when the screen shuts off, and resumed when the screen turns back on. However, this isn't necessarily when the user unlocks the screen. If the person doesn't click out of the app before locking the phone, it will pause properly but it will resume the application (and therefore the timer) when the screen turns back on, not when it's unlocked. People who don't use a lock screen won't see an issue at all, but if you leave the screen on and locked for any length of time, the timer will definitely reflect this.
I started fixing this using a broadcast receiver that gets a signal from the intent when the screen is unlocked. It works for the most part, but not in a situation like this: lock the screen, and say you turn the screen on to check the time or something but you don't unlock the phone, and then just turn it back off. When you DO unlock your phone and look at the app, it shows that the timer has been counting up, and I'm not really sure why it does this or how to fix it yet, or if I can using the broadcast receiver object. I have to look into it some more and find a better solution.
No comments:
Post a Comment