How To Add A Notification Alert Badge In An Android ImageView


Ever wanted to create an icon from an ImageView with a notification alert badge like in the image below? In Android, there is no shortcut in implementing this. I wish there is one but no such luck.

You have to do it on your own. Luckily, the layout system is pretty handy. I made it work with the XML code below.

The TextView will contain both the total count and the image badge. It is actually quite easy, if you know how to use RelativeLayout. I hope this helps.

This should let you feature ImageView icons with alert badges in your app. Just change the values of the images, colors and text.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *