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.
提示这个错误的时候,只需要在配置文件中,找到对应的activity的设置其样式为:
android:theme="@style/AppTheme.NoActionBar">
如果没有成功的话可以在Android的styles.xml中配置如下的命令即可:
<style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> </style>
本文介绍了解决Android应用中ActionBar与Toolbar冲突的问题。通过调整主题样式,禁用默认的ActionBar,并使用Toolbar作为替代方案。
1967

被折叠的 条评论
为什么被折叠?



