I have an issue that when I leave the android device idle for a bit (it sleeps and locks, then I have to unlock it), it seems that my OnCreat method is called again because my variables are resetted and the layout is redrawn again!
Is there a way I can preserve the state and continues from where it was after its being unlocked (or awaken again)?
Thank you very much
I have an issue that when I leave the android device idle for a
Share
When you go out of your activity (pressing back, a call is received, pressing home, locking, etc) the acitivity calls the
onPause()method and then loses all saved information (unless you use only the provided widgets in the Android framework).Therefore you need to save that information overriding the
onPause()method. Then you need to load that information in theonResume()method.For more information check: http://developer.android.com/reference/android/app/Activity.html