问题
When I switch to a certain activity, I want that activity to show up in landscape mode.
In my XML for that actvitiy:
android:screenOrientation="landscape"
most tutorials stated this is all that's needed, yet when that activity is switched to it doesn't automatically change orientation.
fixed: the code needed to be in the manifest under the specific activity
回答1:
In your activity tag, instead of just:
android:screenOrientation="landscape"
I would set:
android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden"
It takes care of a few more things for you.
回答2:
fixed: the code needed to be in the manifest under the specific activity
来源:https://stackoverflow.com/questions/21243189/android-screen-orientation-forcing-landscape