Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display unread count to the android app icon?

Tags:

android

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.

enter image description here

Like the above image I want to display unread count in my application icon.

like image 435
Android_kalai Avatar asked Aug 17 '13 04:08

Android_kalai


2 Answers

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).

like image 179
Niranj Patel Avatar answered Oct 21 '22 16:10

Niranj Patel


  1. 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

  1. 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/

like image 31
DeepakPanwar Avatar answered Oct 21 '22 14:10

DeepakPanwar