打开AndroidManifest.xml,找到该activity的声明,并添加以下属性: android:configChanges="orientation|keyboardHidden|screenSize"