Android O : Only fullscreen opaque activities can request orientation

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/mazaiting/article/details/85002132

异常

3110861-45fb8efa8675e262.png
异常.png

解决方法

  1. 找到报此异常的Activity,将主题中的将windowIsTranslucent属性设置为false
  2. 并设置windowDisablePreview属性为ture
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowIsTranslucent">false</item>
        <item name="android:windowDisablePreview">true</item>
    </style>

</resources>

猜你喜欢

转载自blog.csdn.net/mazaiting/article/details/85002132