简体   繁体   English

我想在Android中的启动器图标上显示通知计数(徽章)

[英]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.

相关问题 Android App Icon中的通知计数徽章 - Notification Count Badge in Android App Icon 在图标启动器android中显示抗辩通知 - display counter notification in icon launcher android 启动器图标上的Android通知 - Android Notification on Launcher Icon 如何在奥利奥的应用程序图标上显示多个通知计数徽章? - How to display multiple notification count badge on app icon in Oreo? 如何以编程方式在Android上的应用程序图标上显示推送通知徽章计数? - How to show push notification badge count on app icon in android programmatically? 在Android 5.0棒棒糖中制作带有徽章/计数的工具栏通知图标 - make toolbar notification icon with badge/count in android 5.0 lollipop 如何使用 Ionic 2 在 Android 应用程序图标中增加徽章计数通知? - How to increase badge count notification in the Android app icon using Ionic 2? 如何在后台在Android应用程序图标上计算推送通知消息徽章 - How to count Push notification message badge on android app icon in background 我可以在Android和小通知图标上禁用通知徽章吗? - Can I disable notification badge on android and small notification icon? 如何在android中的应用程序图标上显示徽章计数? ShortcutBadger 不起作用,我不想使用小部件 - How can i show the badge count on app icon in android? ShortcutBadger does not work, I don't want to use widget
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM