0

I am using the ActionBar from the ActionBarSherlock library. I am able to set the background color of my action bar using the ActionBar.setBackgroundDrawable(Color) method. After changing the background color, I later need to revert it back to the original/default ActionBar color.

How can I determine what the original/default color used for the ActionBar was?

Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
  • More importantly, are you quite certain that you can change the `ActionBarSherlock`s background `Drawable` multiple times? I never had much luck with this (from vague memory, I think that subsequent calls to `.setBackgroundDrawable()` had no effect when I tried). In the end I just got fed up with faffing about and resorted to doing any clever background colour stuff for the `ActionBar` by just shoving a `View` behind it. – Trevor May 23 '13 at 15:26
  • Trevor, I've done a test and I am able to change the backgound colour multiple times. – Adil Hussain May 23 '13 at 15:45
  • Ah, in that case I'll get back into my box. Ignore my comment. – Trevor May 23 '13 at 15:45

2 Answers2

1

Depends on the theme you are using. It should be

  • R.drawable.abs__ab_transparent_dark_holo for Theme.Sherlock
  • R.drawable.abs__ab_solid_light_holo for Theme.Sherlock.Light
  • R.drawable.abs__ab_solid_dark_holo for Theme.Sherlock.Light.DarkActionBar
Matthias Robbers
  • 15,689
  • 6
  • 63
  • 73
-1

Don't just Create a Model class that will remember what you are setting, and you be able to roll back when ever you wish.

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216