activity 继承 AppCompatActivity 后设置默认titlebar不显示时会出现这样的错误。改正办法如下:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
只需要将parent中的代码改为如上代码即可。