Activity屏幕旋转时被销毁

来源:转载

之前的一个Activity的设置为android:configChanges="orientation|keyboardHidden",为保证屏幕旋转时不会重新调用各生命周期
后在修改了sdkVersion时,发现切屏时该Activity被销毁

compileSdkVersion buildToolsVersion
需要再加上ScreenSize可修复此问题
<activity android:name=".MyApp" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|fontScale|screenSize" android:label="@string/app_name" android:launchMode="singleTop" android:screenOrientation="behind" android:theme="@style/Theme.NoTitleBar.Fullscreen.Activity.Main" ></activity>

分享给朋友:
您可能感兴趣的文章:
随机阅读: