日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

关于Android 中 一个错误的解决办法 “Do not request Window.FEATURE_ACTION_BAR.....

發布時間:2024/9/30 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 关于Android 中 一个错误的解决办法 “Do not request Window.FEATURE_ACTION_BAR..... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原因: Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. 解決辦法:

I think you're developing for Android Lollipop, but anyway include this line:

<item name="windowActionBar">false</item>

to your theme declaration inside of your?app/src/main/res/values/styles.xml.

Also, if you're using?AppCompatActivity?support library of version 22.1 or greater, add this line:

<item name="windowNoTitle">true</item>

Your theme declaration may look like this after all these additions:

<!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"><!-- Customize your theme here. --><item name="colorPrimary">@color/colorPrimary</item><item name="colorPrimaryDark">@color/colorPrimaryDark</item><item name="colorAccent">@color/colorAccent</item><item name="windowActionBar">false</item><item name="windowNoTitle">true</item> </style>

總結

以上是生活随笔為你收集整理的关于Android 中 一个错误的解决办法 “Do not request Window.FEATURE_ACTION_BAR.....的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。