默认第一次竖屏运行
Activity生命周期如下:
onCreate
onStart
onResume
切换成横屏:
onPause
onStop
onDestory
onCreate
onStart
onRestoreInstanceState
onResume
再次切换成竖屏:
onPause:
onStop:
onDestroy:
onCreate:
onStart:
onRestoreInstanceState:
onResume:
在AndroidManifest文件给Activity设置:
android:configChanges="orientation|screenSize|keyboardHidden"
设置后横竖屏切换不会重走Activity生命周期