This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE
来源:互联网 发布:微信发假金额红包软件 编辑:程序博客网 时间:2024/05/17 22:42
异常信息:
Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
window decor. Do not request Window.FEATURE_SUPPORT_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.
at
android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_scrolling); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); }
当用了setSupportActionBar(toolbar);
同时android:theme=”@style/AppTheme”时
就会抛出这个异常
解决办法:
AndroidManifest.xml 对应的Activity标签的android:theme改为含有NoActionBar的
<activity android:theme="@style/AppTheme.NoActionBar">
android:theme="@style/Theme.AppCompat.Light.NoActionBar"android:theme="@style/Theme.AppCompat.NoActionBar"
注意:
以下这种形式是无效的
requestWindowFeature(Window.FEATURE_NO_TITLE);setContentView(R.layout.activity_scrolling);
0 0
- This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE
- This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_
- This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_
- android开发错误-This Activity already has an action bar supplied by the window decor. Do not request Win
- 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
- 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
- 关于继承parent="Theme.AppCompat"错误:This Activity already has an action bar supplied by the window decor
- 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
- Caused by: java.lang.IllegalStateException: This Activity already has an action bar supplied by the
- STM32的启动过程
- 机器学习与R笔记之线性回归
- Button的三种监听方法
- python 安装easy_install和pip
- Leetcode 110. Balanced Binary Tree (Easy) (cpp)
- This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE
- MFC中Picture控件,将位图转换成任意大小再放入控件中
- AssetsBundle 学习(一)
- android中的ListView数据量大时如何提高效率。。。。
- python学习——编写Web App骨架
- 2016XTU算法专题个人赛2 题解
- jQuery基础-DOM篇2
- mysql中key 、primary key 、unique key 与index区别
- 控件封装的一点心得