Android通知栏数量
我已经能够在 Android 模拟器上成功显示通知数量。但是,当我在实际的 Android 手机上使用它时,它不会显示任何内容。关于为什么可能存在差异有什么建议吗?
I've been able to successfully display the notification number count on the Android emulator. However, it doesn't display anything when I use it on an actual Android phone. Any suggestions on why there might be a difference?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
尝试先将其设置为数字 1,然后再设置更高。来自此处的建议: http://developer.android.com/guide/主题/ui/notifiers/notifications.html
Try first setting it up with the number 1, then go higher. Suggestion from here: http://developer.android.com/guide/topics/ui/notifiers/notifications.html
就我而言,这是手机的问题。这是一个不可思议的机器人。它不适用于 android 2.1,但 Verizon 发布的 2.2 解决了这个问题。
In my case it was something with the phone. It was a Droid Incredible. It didn't work with android 2.1, but Verizon's release of 2.2 fixed the issue.
(为了后人)
为了详细说明Izkata所说的,如果您发布了一个没有“数字”计数的通知,并且您想然后添加该数字,您需要取消现有的通知并使用设置的数字字段重新制作它。 (“取消”是NotificationManager 方法之一。)从0 到数字将不会显示该数字,除非您取消原始通知。
同样,如果您有一个带有号码的通知,并且想要返回到空白通知,则需要取消当前通知并重新制作没有号码的通知。从数字到 0 只会显示绿色的小气泡,里面什么也没有。
请注意,如果您只想更改现有号码,只需使用新号码重新发出通知即可,无需取消前一个号码。
(for posterity)
To elaborate on what Izkata said, if you put up a notification with no "number" count and you want to then add the number, you need to cancel the existing notification and remake it with the number field set. ("cancel" is one of the NotificationManager methods.) Going from 0 to a number will not display the number unless you cancel the original notification.
Similarly, if you have a notification up with a number on it and want to go back to a blank notification, you need to cancel the current one and remake it with no number. Going from a number to 0 will just show the little green bubble with nothing in it.
Note that if you just want to change an existing number, you can just re-issue the notification with the new number -- no need to cancel the previous one.
它对
我有用......
}
it works for me....