When i connect my android phone to my computer, compile my project in eclipse and upload my app to my deivce everything works fine. Including pressing the home button, if i press home, and come back to the app later the game state is saved and returns. However if I export my app (As if I was going to release it) and then let’s say email it to myself, and install it that way. Everytime I hit the home key and then reopen my app, it completely restarts my app. (doesn’t save state) is something different in the debugging verison of the app? Also note, if i install the app from eclipse, disconnect my device from the computer and run it that way, it still remembers the state like it should! Only the exported copy will not work correctly.
Share
It is up to you to save the state and restore it when you return to your app.
It sounds like you are relying on the system not killing your app as your save state method.
You should understand the Activity Lifecycle and work with it. The system will eventually shut down your app and reclaim its memory regardless of how you deploy the app to your phone.