开发者

Android SDK onCreate problem

开发者 https://www.devze.com 2023-04-06 18:15 出处:网络
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 wh

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):

  1. Tap app icon to open app, onCreate is called
  2. Hit home button, state is saved
  3. 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:

  1. Tap app icon to open app, onCreate is called
  2. Hit home button, state is saved
  3. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消