Dynamic Drawable Icon For Actionbar Menu Item? (android, Actionbarsherlock)
How can I dynamically update the icon for an ActionBar MenuItem to show a 'red badge' with a number? (conceptually similar to 'unread message count') I'm using ActionBarSherlock in
Solution 1:
There are a lot of ways to do this:
- Use
LayerDrawable
and stack badge images on top of your icon image. - Write a custom class which extends from
Drawable
and draws the icon and badge manually. - Use a custom action item view with your icon in an
ImageView
with aTextView
overlay for the badge.
Post a Comment for "Dynamic Drawable Icon For Actionbar Menu Item? (android, Actionbarsherlock)"