Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Jump
I am familiar with the activity lifecycle. To make myself clear. I am finding the behavior strange in this case. 1. Running the app then bringing it to the background by pressing home and then pushing the lock button does not destroy my activity. 2. Running the app then pushing the lock button

Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Justin Anderson
* I am familiar with the activity lifecycle. To make myself clear. I am finding the behavior strange in this case.* My point still stands... You can't control the Activity Lifecycle. I think it is strange as well. But that doesn't mean I have any control over it. If you feel it is a bug then

Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Dianne Hackborn
The reason an activity is destroyed and re-created is to run it with a new configuration. You haven't said all that much about what you are doing so it is hard to know what is going on, but I would assume that you have forced an orientation for your activity, and the lock screen has a different

Ang.: Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Jump
Wow, your assumption was correct! :D I am forcing landscape mode since it's a game. I just added android:configChanges=orientation and this was the solution to my problem. I see the importance of configChanges. I will probably add keyboard and keyboardHidden as well. Locale is ok if it

Re: Ang.: Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Dianne Hackborn
Um. You totally missed my point. Don't throw a bunch of stuff in to config changes. FIX YOUR APP. I said, throwing things into config changes does NOT fix the problem. You need to make sure your app correctly deals with config changes, because they CAN and WILL happen. Once you do that, then

Ang.: Re: Ang.: Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Jump
There's nothing wrong with my app. I just want to prevent it from restarting unnecessarily since it loads textures n' stuff. If i need it, I will handle configuration changes at runtime. -- You received this message because you are subscribed to the Google Groups Android Developers group. To

Re: Ang.: Re: Ang.: Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Dianne Hackborn
It would be nice if you could set up your e-mail app to retain the same header. The correct way to do this is to use things like: http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance() On Fri, May 13, 2011 at 5:31 PM, Jump ras...@gmail.com wrote:

Ang.: Re: Ang.: Re: Ang.: Re: Ang.: Re: [android-developers] Activity is destroyed than instantly created when pushing the sleep/lock-screen button

2011-05-13 Thread Jump
Yes, that's what I was referring to. I also saw the Handling Runtime Changeshttp://developer.android.com/guide/topics/resources/runtime-changes.html post. Thx! (Regarding the header. If you mean the Ang:. I am responding directly from google groups webgui which defaults to my local language.