[android-developers] Saving Activity state when pressing Home

2009-11-19 Thread jax
I need to store a variable that contains my application state restoredClockTime I do this in onSaveInstanceState and onRestoreInstanceState and it works when I flip the screen on the G1. The problem is when I press the Home button and then re-enter the activity it does not work. why is this?

Re: [android-developers] Saving Activity state when pressing Home

2009-11-19 Thread TreKing
onSaveInstanceState gets called when you're activity is likely to be killed off so you can restore it when it's recreated. When you open / close the keyboard on the G1 your activity gets destroyed and recreated, triggering the call to onSaveInstanceState. Pressing the Home key, however, will only

Re: [android-developers] Saving Activity state when pressing Home

2009-11-19 Thread TreKing
You might want to save your variable when onPause gets called. Forgot to add, and restore it in onResume(). - TreKing - Chicago transit tracking app for Android-powered devices