[英]i want to display notification count (badge)on launcher icon in android
i am an android developer.i want to display notification count on launcher icon in android.It can be possible with "shortcutBadger" library but it is not working for android versions 5, 6 and 7. i don't want widget option.Can any one suggest me the solution. 我是一名Android开发人员。我想在android中的启动器图标上显示通知计数。可以通过“ shortcutBadger”库进行操作,但不适用于Android 5、6和7版本。我不希望使用widget选项。任何人都可以向我提出解决方案。 Thank you in advance.
先感谢您。
The shortcut badger support the notification counter on specific devices as it is stated in the repository description: "An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers." 快捷方式标记器支持特定设备上的通知计数器,如存储库描述中所述:“ Android库支持标记通知,例如Samsung,LG,Sony和HTC启动器中的iOS。”
This covers some huawei, xiaomi and other devices....it is not related to the OS version, you probably didn't pay attention to the devices list or didn't implement it correctly. 它涵盖了一些华为,小米和其他设备。。。它与操作系统版本无关,您可能没有注意设备列表或未正确实现它。 (i've tested the library multiple times and works correctly)
(我已经对该库进行了多次测试,并且可以正常工作)
So it is currently one of your best options if you want to support older OS versions. 因此,如果您想支持较早的OS版本,它是当前最佳的选择之一。
https://github.com/leolin310148/ShortcutBadger https://github.com/leolin310148/ShortcutBadger
Also starting with Android 8 you can use the "similar" native option https://developer.android.com/guide/topics/ui/notifiers/notifications.html#Badges 同样从Android 8开始,您可以使用“相似”本机选项https://developer.android.com/guide/topics/ui/notifiers/notifications.html#Badges
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.