I am creating an App. It has 4 count-down timers. My problem is, In the middle of the count-down timer running user may press the back key and close the App. I want to let the countdown-timer run it's count so that the user can see the updated version of it when he opens the App on next time. I thought to manage the state using onSaveInstanceState Callback but I read in the document that it been not called on the event of back key press of the activity. And I tried to check...yes it is not. Is any chance I can solve this using services?
Can someone shed开发者_如何学C some light on this please.
Note: I am using Handler.postDelayed for running count-down timers.
Thanks
If you want to catch the event when the user presses the back key, there's a method on the Activity class you can override, I believe it's onBackKeyPressed
精彩评论