views:

247

answers:

2

Hi, I am trying to add badges to the icons in my android app. e.g. in the facebook app(for iPhone), in the home page the number of pending requests is shown on the requests icon.

Can someone provide any links/ideas on how to do this?

Thanks

+2  A: 

Android doesn't support badges on icons.

Instead, it provides the notification system (icons in the notification bar, etc), as well as the ability to create widgets that can be added to the users "desktop".

synic
+6  A: 

If you really want to do it. Use a FrameLayout which contains an ImageView with your icon and a TextView with a ninepatch drawable as background in the right corner. Add margins to the ImageView if you want the badge to be a bit outside the icon.

This is basically what I did for Gmail Unread Count.

alexanderblom
Very cool, gonna have to install that one.
synic