Hi everyone,

I got this request from certain user group that they would like an option to
fix my application in portrait mode. So here is what I did:

1) added android:configChanges="orientation" into main activity in
AndroidManifest.xml

2) overridden onConfigurationChanged(Configuration newConfig) in main
activity

3) put these lines inside the method:

if (userPrefPortrait)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
else setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER);

Now my problem is that the app starts in normal mode, one can rotate the
screen. After selecting the portrait-only behavior, it still work as
expected - screen can't be rotated. But when I turn off the portrait-only
mode, it stays in it and the screen still can't be rotated. I thought that
I'm using bad ActivityInfo constant at first, but tried also UNSPECIFIED and
SENSOR and is still the same. I'm pretty sure I'm just missing something.
Anyone got a clue about this?

Thanks in advance.
Filip Havlicek

-- 
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

Reply via email to