[android-developers] How to lock current orientation at runtime?

2011-07-16 Thread Brad
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

Re: [android-developers] How to lock current orientation at runtime?

2011-07-16 Thread Kostya Vasilyev
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

Re: [android-developers] How to lock current orientation at runtime?

2011-07-16 Thread Nick Risaro
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

Re: [android-developers] How to lock current orientation at runtime?

2011-07-16 Thread Dianne Hackborn
Those are two different orientations. The Configuration constants: http://developer.android.com/reference/android/content/res/Configuration.html#ORIENTATION_LANDSCAPE The constants for set/getRequestedOrientation():