This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead.

 

解决方式:

打开Style,设置为

<style name="AppTheme" parent="AppTheme.Base" />

<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="android:windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
</style>
<style name="AppTheme.NoActionBar">
    <item name="android:windowActionBar">false</item>
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowNoTitle">true</item>
</style>

 

相关文章:

  • 2021-05-31
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2021-10-06
  • 2021-06-05
猜你喜欢
  • 2021-08-06
  • 2021-06-28
  • 2021-03-26
  • 2021-06-22
  • 2022-12-23
  • 2021-12-20
  • 2022-12-23
相关资源
相似解决方案