Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
来源:互联网 发布:php.ini cookie设置 编辑:程序博客网 时间:2024/05/20 13:14
随手记录出现该bug的解决办法。
Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not requestWindow.FEATURE_SUPPORT_ACTION_BARand set windowActionBar to false in your theme to use a Toolbar instead.
今天新建了一个activity并在activity里面设置这句话
setSupporActivity(toolbar);
然后就上面这个错误了。
分析可能是因为在application节点中引用了 @style/AppTheme样式,而这个样式自带actionbar
所以我们在activit里面 setSupporActivity(toolbar)就会报这个错误。
解决办法:
去掉代码中的setSupporActivity(toolbar);使用application 的样式
或者在清单文件中 activity节点下加入
<activity android:name=".activity.MainActivity" android:theme="@style/AppTheme.NoActionBar" />
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> <item name="android:statusBarColor">@android:color/transparent</item></style>
2 0
- Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
- Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
- Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
- Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied b
- java.lang.IllegalStateException: This Activity already has an action bar supplied by the window deco
- java.lang.IllegalStateException: This Activity already has an action bar supplied by the window deco
- java.lang.IllegalStateException: This Activity already has an action bar supplied by the window deco
- IllegalStateException: This Activity already has an action bar supplied by the window decor.
- This Activity already has an action bar supplied by the window decor
- 解决 This Activity already has an action bar supplied by the window decor 错误
- This Activity already has an action bar supplied by the window decor.
- This Activity already has an action bar supplied by the window decor.
- 错误集锦之一:This Activity already has an action bar supplied by the window decor.
- 错误集锦之一:This Activity already has an action bar supplied by the window decor.
- Android异常:This Activity already has an action bar supplied by the window decor
- This Activity already has an action bar supplied by the window decor
- 关于继承parent="Theme.AppCompat"错误:This Activity already has an action bar supplied by the window decor
- This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE
- scala 中的类定义与getter setter
- eclipse 打包apk时 出现 no dex file found
- 【USACO 2002 February】BUY LOW,BUY LOWER 低价购买
- 性能测试之LoadRunner使用(一)
- a标签中使用img后的高度多了几个像素
- Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
- DOS石头剪刀布(随机数的练习)
- 将XenServer系统盘上的未分配空间利用起来
- leetcode142
- Oracle 以某字段分组,以某字段排序,取前几条
- Android自定义饼形图
- 传值和传引用、传指针的区别
- Swift- String和Int类型互换
- github的基本操作