Android报错之This Activity already has an action bar supplied by the window decor 2.0
一、报错
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.
二、解决方法
1.修改themes.xml,添加style代码
<style name="Theme.TYLDApp.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
2.修改Androidmanifest.xml,在相应的Activity里加入android:theme=“@style/Theme.TYLDApp.NoActionBar”
android:theme="@style/Theme.TYLDApp.NoActionBar"
完美解决!!!