Re: [android-developers] Re: onCreate and orientation change
Thank you so much, you saved my life with this simple tip. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: onCreate and orientation change
On Wed, Apr 28, 2010 at 11:42 AM, Amir Alagic amirs...@gmail.com wrote: Add this android:configChanges=keyboardHidden|orientation|keyboard to activity element in AndroidManifest.xml file. I hope that this is what you want. No, don't. That doesn't fix the problem, just hides it in some of the common situations. (This also breaks many behaviors around configuration, such as selecting the right value for any resource that varies based on one of these configurations.) The correct solution is to write your activity correctly so that it does the right thing when it is re-created from a previous saved state. -- Dianne Hackborn Android framework engineer hack...@android.com Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: onCreate and orientation change
Hi, You could consider moving part of the logic of your application to a service. That would mean that the logic is separated from the UI, and thus will not be affected by UI changes. Best regards Bex On Apr 28, 2:39 pm, NicoToc nicolas.mayn...@gmail.com wrote: Hi, I have an activity that checks stuffs online when it's created (is the GPS on and if not it asks if the user wants to turn it on). The problem I'm having is that it is also doing it everytime I change the orientation of the screen. I've read some comments on onConfigurationChanged() but is there a better way to be sure I'm checking the GPS only when the activity is first created? Thanks a lot Nicolas -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: onCreate and orientation change
Hi, Add this android:configChanges=keyboardHidden|orientation|keyboard to activity element in AndroidManifest.xml file. I hope that this is what you want. On Apr 28, 7:39 am, NicoToc nicolas.mayn...@gmail.com wrote: Hi, I have an activity that checks stuffs online when it's created (is the GPS on and if not it asks if the user wants to turn it on). The problem I'm having is that it is also doing it everytime I change the orientation of the screen. I've read some comments on onConfigurationChanged() but is there a better way to be sure I'm checking the GPS only when the activity is first created? Thanks a lot Nicolas -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en