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>