I also looked for a solution for this in the android sdk and found none so i went and wrote a custom TabWidget for it.
The short version:
- Extend the TabWidget class and override the method: drawChild (Canvas canvas, View child, long drawingTime)
- In the painting you simply draw a Bitmap ontop of the canvas. You get the x location of the child with child.getRight() and subtract the width of your badge Bitmap. Also draw the text for the badge number ontop of that.
- To keep a state for each tab you could use a HashMap with keys for the index of each tab.
- To be able to update the tabs from anywhere i used a singleton class with the widget inside that i initialize from the main activity.
More info can be found here, including the source code for an example android project:
http://nilisoft.com/?p=622
Enjoy!