How to display unread count to the android app icon?
Unfortunately, You can't do that on application icon. Android doesn't allow that.
But you can do that using widget. There are many question related this, check it first.
Question 1
Question 2
Question 3
Widget Example
Widget Link
Update : 24/04/2015
Now this is possible for some launcher app.
Check this ShortcutBadger and BadgeUtils
Update
Android allow Modify a Notification Badge from Android 8.0 (PI level 26).
- Showing Badge in application icon is not allowed by default in Android. We can do this in some of the customized devices available in android: Below are the links how we can show on some Device like Sony,Samsung etc.
https://github.com/leolin310148/ShortcutBadger
Utility Class I found on git:- will be helpful also
https://gist.github.com/Tadas44/cdae2f5995f21bf1c27f
- And for rest of the Non customized devices we can create a custom widget to reflect this same behaviour.
See How to create Widget: https://looksok.wordpress.com/2012/12/15/android-complete-widget-tutorial-including-source-code/