I would like to programmatically set the background of an ActionBar item to draw as a specific color.
For a View I would accomplish this by setting the background of the View to a custom selector, which uses my specific color for the “selected” state; then I would call View.setSelected(boolean) to toggle the specific color on and off.
Is there a way to accomplish the same effect for items in the ActionBar?
A lot of the styling of the action bar is done via images so I think the only way to do this is by creating a custom style or theme. See here http://android-developers.blogspot.com/2011/04/customizing-action-bar.html for more detail and also check out the sample code here http://code.google.com/p/styled-action-bar/ .