I think I've gotten myself seriously confused. Up until recently my app was working great. I hadn't changed anything except updated java and android tools. I'm not sure if that caused my problem or what, that's all I can remember cha开发者_如何学Gonging related to it.
Here's the problem I'm running into, which just started.
Debug mode (installed app on phone through Eclipse):
- Tap app icon to open app, onCreate is called
- Hit home button, state is saved
- Tap app icon to open app, it resumes, onCreate is not called
That worked, my app is happy.
Now I export the signed and zip aligned app, remove the app on my phone, install the new one, and repeat these steps:
- Tap app icon to open app, onCreate is called
- Hit home button, state is saved
- Tap app icon to open app, onCreate is called again
Ugg, onCreate is called again? Bundle is null, my variables reset. This happens on the emulator too and for other users of the app. I can hold the home button down and switch to it and it continue where it left off but if I tap the icon it calls onCreate every single time.
Why is this happening? My app is a single activity.
精彩评论