If you add android:configChanges="orientation" to your activity in the manifest then the method "onConfigurationChanged" of your activity will be called, here you can decide what to do with the change, but most important, the activity will not be restarted.
You can check this http://developer.android.com/guide/topics/resources/runtime-changes.htmlwhere it's better explained. 2011/7/16 Kostya Vasilyev <kmans...@gmail.com> > Assuming you lock the orientation, how will you prevent the user from > sliding out the keyboard on those devices that have it? (For the duration of > your HTTP request.) > > Less plausible, but possible as well, from changing the phone's configured > UI language? > > -- > Kostya Vasilyev > 17.07.2011 2:41 пользователь "Brad" <bradfull...@gmail.com> написал: > > > Hi, > > > > I'm trying to lock my activity to the current orientation to prevent > > an orientation change from restarting my activity while I'm waiting > > for a http response. > > > > So I'm trying to use this: > > > > setRequestedOrientation(getResources().getConfiguration().orientation); > > > > And it works fine for portrait (orientation == 1), but when the device > > is in landscape it's getting a value of 2 which == > > > > ActivityInfo.SCREEN_ORIENTATION_USER > > > > And this doesn't lock the screen. > > > > Does anyone have any idea why I'm getting this instead of LANDSCAPE? > > Any suggestions for a better way to lock the current orientation? > > > > Thanks! > > > > -- > > 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 > > -- > 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 > -- 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