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

前端 未结 3 2148
闹比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 15:53
    Define this style 
    <style name="NoActionBarTheme" parent="Theme.AppCompat.Light.NoActionBar">
                <!-- Customize your theme here. -->
                <item name="textColorError">@color/design_textinput_error_color_light</item>
                <item name="android:windowNoTitle">true</item>
                <item name="android:windowActionBar">false</item>
                <item name="android:actionMenuTextColor">@color/color_white</item>
                <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
            </style> 
    Please use this in your androidmanifest.xml file.This will resolve your problem. 
    
    0 讨论(0)
  • 2021-02-12 16:01

    Use style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar" and everywhere use the same Theme as this maintain flow of Context to Android as it do not get confused between two ActionBar.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题