Crash on android 4.4.2: This Activity already has an action bar supplied by the window decor

My application is crashing with this error when i run it into android 4.4.2:

Caused by: 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.

I'm using a Toolbar and i'm setting the base theme as .NoActionBar so it should work fine.

This is my default theme.xml:

 <style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>

I've tried also windowActionBar = false and windowNoTitle = true but is still not working. Can someone help me with this error?

EDIT In the manifest i'm just doing this:

android:theme="@style/AppTheme.Mezzo" 

with

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

Answers


Try using this style

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>

    <item name="android:windowContentTransitions">true</item>
</style>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

And using it in manifest

 android:theme="@style/AppTheme.NoActionBar" 

In your activity tag


Need Your Help

Python Manage.py Commands Not Recognized on Heroku

python django heroku django-manage.py manage.py

Trying to run heroku run python manage.py migrate --remote [my app] and it is outputting a list of subcommands. Tried various other django commands with the same result, everything from 'shell' to ...