Screen orientation in only one child of a ViewSwitcher in Android
I've got a ViewSwitcher
containing a LinearLayout
in position 0, and an ImageView
in position 1.
Now I want the LinearLayout
only to be shown as Portrait, and, when the ImageView
is shown, give the user the chance to rotate the device and see that view in Landscape mode.
So, I added android:configChanges="orientation"
in the Activity in my AndroidManifest.xml
file.
Then I need to override onConfigurationChanged (Configuration newConfig)
in my Activity, but I can't find any way to get what I want...
I've tried editing newConfig.orientation
param directly, before calling super.onConfigurationChanged(newConfig)
, and also creating a new开发者_C百科 Configuration
from newConfig
and using updateFrom
method, but It doesn't work.
Any idea?
Thank you
include also keyboardhidden
android:configChanges="orientation|keyboardHidden"
精彩评论