Android 8.0 安裝後無法啓動~~~~

andriod 8.0 啓動就奔潰了,無法啓動,查看日誌後發現Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation,(log查看方式:adb logcat -I)

也就是說android 8.0 透明的activity 不能繼續使用 

綜合其他大神的結論:

把android 下面的src下面的main下面res下面values下面的styles文件

<resources>

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

</resources>

windowIsTranslucent改爲windowDisablePreview就能起到一樣子的效果了,且應用不會崩潰了。

 

重新打包,即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章