Android ActionBar Icon Visibility

Needed to put an icon in the action bar for a “refresh” action of an Android app.

Setting an icon is simple, in the Action class something like:

public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(, menu);
return super.onCreateOptionsMenu(menu);

Which  requires having the associated XML resource file defined for “my_menu.xml” in /res/menu folder. Something like:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="">
<item android:id="@+id/action_refresh"

Nothing too complicated. But then need a nice icon for it. Luckily Google provides some nice set of action icons available (at this time) at:

Which has the “ic_action_refresh” icon referenced in the XML above. So the problem then. There are two themes. Holo Light and Holo Dark. Using either of these the refresh icon always looks disabled. Why? Where is a bunch of instructions if you go looking to tweak this and tweak that.

What I found is the problem is that both of these have a high transparency value (perfect way to make a disabled look if you think about it..). Luckily there is a separate set of icons called “unstyled” or something like that. Using the refresh icon from this set actually makes the icon look enabled.. Now that is was fun to “debug”, or not.

Why make such sets? I have no idea. Probably I am just missing some big idea in Android UI design. Well, as long as it works for me now..


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s