There are many kinds of switches on Android landscape and vertical screen. But some of the methods introduced are on older versions of Android.
I am now using the situation to write down for memo:
Android version: 4.0-4.4
Requirement: No need to recall OnCreate method when Android screen conversion
Steps:
1, in androidmenifest corresponding activity inside add android:configchanges= "orientation|keyboardhidden| screensize"
2, in the code such as (Roomactivity.java) need a horizontal screen of the place Call method Setrequestedorientation (Activityinfo.screen_orientation_landscape)
3, in the code need vertical screen of the place Setrequestedorientation (activityinfo.screen_orientation_portrait);
Note
1, Setrequestedorientation () is the activity class inside the method
2, ScreenSize (red bold place) This parameter in the Android 4.0 after the version is required, otherwise the screen switch between the time the program will recall the activity inside the OnCreate method.
Switching between the Android screen and the vertical screen