1

I've got AppCompatActivity that is not using Toolbar. I'm trying to style my SupportActionBar in this activity, by setting a proper theme. The theme below doesn't work (when assigned to Activity in AndroidManifest)

<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme"
       parent="@android:style/Theme.Holo.Light.DarkActionBar">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
</style>

<!-- ActionBar styles -->
<style name="MyActionBar"
       parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
    <item name="android:background">@drawable/actionbar_background</item>
</style>

Only changing colorPrimary works (changes the color of SupportActionBar).

My question is - where is the style of SupportActionBar derived from? How to assign theme to AppCompatActivity properly?

Sujatha Girijala
  • 1,141
  • 8
  • 20
user3554626
  • 425
  • 1
  • 5
  • 9
  • Check this https://stackoverflow.com/questions/18288402/how-to-set-custom-actionbar-color-style – Crammeur Aug 08 '18 at 10:15
  • First of all for AppCompat we need to inherit from parent="Theme.AppCompat.Light.DarkActionBar" But then it doesn't work anyway. And I don't want to change color only but the styling (like background drawable). I didn't see any way to do that without using Toolbar yet. Question is - is it possible at all? – user3554626 Aug 08 '18 at 10:36
  • http://www.androiddocs.com/training/basics/actionbar/styling.html Has a partial answer in the Note section at the start of document. Anyone got that working? I couldn't find appcompat.R.attr properties. How does the code look like? – user3554626 Aug 08 '18 at 10:37
  • try this `@android:style/Theme.DeviceDefault.Light` – Crammeur Aug 08 '18 at 10:49
  • I have update android studio and I have the same bug so thank for the question – Crammeur Aug 08 '18 at 11:03
  • Check there https://developer.android.com/reference/android/R.attr – Crammeur Aug 08 '18 at 11:07

0 Answers0