Search code examples
androidandroid-studioandroid-theme

Base.Theme.AppCompat.Light.DarkActionBar vs Theme.AppCompat.Light.DarkActionBar


when I update to android 3.1.3 the design screen not showing anything I googled it and found the solution to change the appTheme parent to

Base.Theme.AppCompat.Light.DarkActionBar

instead of

Theme.AppCompat.Light.DarkActionBar

and worked perfectly.

my question is

why doesn't it work with default one and what is the difference between two themes?


Solution

  • There shouldn't be any difference. If you look up style definition in values.xml of your appcompat library, you can see that Theme.AppCompat.Light.DarkActionBar just extends Base.Theme.AppCompat.Light.DarkActionBar and nothing else.

    The problem seems that there was a bug with how Android Studio handled some versions of the support library. You can find a more detailed answer here:

    Failed to load AppCompat ActionBar with unknown error in android studio

    Anyway, after updating Android Studio to 3.2 and Gradle to 4.6, the problem is gone.