I want to display the unread count to the application icon. I refer the lots of stack overflow answers for achieving that. All the links are saying that it is not possible. But android Mail, Message application displays the unread count at the top of the icon and in some links says that use widget instead of icons. But I don't know how to use the widget instead of icon displays in android application.
Like the above image I want to display unread count in my application 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).
https://github.com/leolin310148/ShortcutBadger
Utility Class I found on git:- will be helpful also
https://gist.github.com/Tadas44/cdae2f5995f21bf1c27f
See How to create Widget: https://looksok.wordpress.com/2012/12/15/android-complete-widget-tutorial-including-source-code/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With