This Activity already has an action bar supplied by the window decor (FEATURE_ACTION_BAR)

前端 未结 3 2149
闹比i
闹比i 2021-02-12 15:17

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 Toolba

3条回答
  •  鱼传尺愫
    2021-02-12 16:18

    In your AppTheme style use,

    Theme.AppCompat.Light.NoActionBar
    

    instead of

    Theme.AppCompat.Light.DarkActionBar
    

    You are setting a theme that has an actionbar and then you are setting toolbar as an actionbar. That's why your are getting this error.

    Use the theme that has no actionbar instead and it will fix the issue.

提交回复
热议问题