android - 如果有多个通知,如何提供计数器

标签 android notifications push-notification

我已经使用 C2dm 实现了 PushNotification。我也收到来自 c2dm 的通知。我的问题是当我收到多个通知时我想给出一个计数器,我的意思是“你有一个通知(计数)”。我该如何实现。

最佳答案

您可以将数字值设置到通知对象中

Notification notifyDetails = new Notification(R.drawable.alarm,intent.getExtras().getString(KEY_TITLE),System.currentTimeMillis());
notifyDetails.number = 1; ////// here you can pass the counter value which will so you the number 

这是链接

http://developer.android.com/reference/android/app/Notification.html#number

http://developer.android.com/guide/topics/ui/notifiers/notifications.html

Android Notification Bar Number

关于android - 如果有多个通知,如何提供计数器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7203541/

相关文章:

android - Periscope App 是如何将视频直播的如此成功?

ios - 具有本地通知重复间隔的多个 uiswitch,在我的应用程序中不太喜欢彼此

android - 检查站点以显示通知

javascript - 如何使用 django-push-notifications 实现 Web 客户端?

iOS 7 远程通知

java - WorkManager 一次执行 enqueueUniquePeriodicWork() 多次?

android - PDF 文件无法在牛轧糖 Android 中打开

android - 通知打开 Activity ,按下后退按钮,打开主要 Activity ?

javascript - PhoneGap 推送插件注册 ID 在移动设备上不起作用

android - Google 云端硬盘 API 不可用