1. When using the activity's default properties in the manifest file, the ondestory and oncreate are unnecessarily costly when the vertical screen is used horizontally. Android By default this should be to adapt to different XML layout files, reinitialization of resources, the display will be better;
2. Configure the properties of the activity in the manifest file:
Android:configchanges= "Orientation|screensize"
The callback function will be in the activity:
public void onconfigurationchanged (Configuration newconfig) {
Super.onconfigurationchanged (Newconfig);
LOG.I (TAG, "onconfigurationchanged:" + newconfig);
};
Can be in this function newconfig parameters, set the level of the required resource replacement and other operations.
Of course: You can use android:screenorientation= "portrait" in Manifest or android:screenorientation= "Landscape" (horizontal) to directly control the vertical screen.