How to show notification count on app icon like Facebook?

旧时模样 提交于 2019-12-03 01:48:50
BooDoo

Unfortunately you cant achieve this for all android devices.

Certain manufacturers (e.g. Samsung or Sony) have included this functionality into their customised Android launchers. Also some 3rd-party launchers (e.g. Nova Launcher) have included an API to accomplish this.

Some related posts for more information:

And some libraries that might be helpful:

and more...

I have found a solution But it work in some devices like samsung , Huawei..

Like ADD Library

implementation "me.leolin:ShortcutBadger:1.1.21@aar"

ADD to Gradle file

repositories {
    mavenCentral()
}

Finally Add this in MainActivity.java file for Check

    int badgeCount = 16;
    ShortcutBadger.applyCount(this, badgeCount); //for 1.1.4+

16 Notification will be visible on app icon

And this is it !!

For detail Click here

ShortcutBadger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!