Are you locking the device in landscape mode? On phones, locking the screen represents an orientation change, a locked screen is always in portrait mode.
This means that if your activity is the top-most one on the screen, it will be destroyed and re-created, and then again when you unlock the device. Can your code handle an orientation change without crashing? -- K 2013/1/30 Davide Moriello <[email protected]> > Hello, I'm developing an android app for some time now. Everything is > going well. When I close my app with the home button and I reopen it there > aren't any problems or crashes. > But, when I have my app open and I lock my screen the app create a new > istance of the activity and call again onCreate when the screen is > locked... so crash! > > the code of my activity is here > http://pastebin.com/j1mTRUnB > > > What can this be? Any suggestion? Thank you a lot =) > > -- > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Android Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

