0

I know there are many built-in themes for ActionBar: Holo Light, Holo Dark, Holo Light with Dark ActionBar...

Is there any way to know, is the current theme of ActionBar is Dark or Light?

3

1 Answer 1

0

With suggest from Android developer community (Google+), I finally find there such method from HoloEverywhere source code: ThemeManager.getThemeType(context)

public static int getThemeType(Context context) { TypedArray a = context.obtainStyledAttributes(new int[] { R.attr.holoTheme }); final int holoTheme = a.getInt(0, 0); a.recycle(); switch (holoTheme) { case 1: return DARK; case 2: return LIGHT; case 3: return MIXED; case 4: return PreferenceManagerHelper.obtainThemeTag(); case 0: default: return INVALID; } } 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.