java.lang.RuntimeException: Unable to start activity ComponentInfo
: 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.
原因是: 已经默认存在了ActionBar,先要设置成没有ActionBar,再设置ToolBar
在样式文件中设置成没有actionBar的
styles.xml -> parent属性