Causedby: java.lang.IllegalStateException:ThisActivityalreadyhasanactionbarsuppliedbythewindow decor. Do not request Window.FEATURE_SUPPORT_ACTION_BARand set windowActionBar to false in your theme to use a Toolbar instead.
at android.support.v7.app.AppCompatDelegateImplV7.setSupportActionBar(AppCompatDelegateImplV7.java:198)
at android.support.v7.app.AppCompatActivity.setSupportActionBar(AppCompatActivity.java:130)
原因:使用了5.0之后的ToolBar而没有去更改activity的style
解决方案:应该将:
<stylename="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">
修改为:
<stylename="AppTheme"parent="Theme.AppCompat.Light.NoActionBar">
网友评论