如果有多个通知,如何进行反击 [英] How to give counter if more than one Notifications are there

查看:20
本文介绍了如果有多个通知,如何进行反击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have implemented PushNotification Using C2dm. I am getting notification from c2dm also. My problem is I want to give a counter when I get more than one notifications, I mean like "You have a Notification(count)". How can I implement this.

推荐答案

你可以将数值设置到 Notification 对象中

you can do to set the number value into the Notification object

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 通知栏编号

这篇关于如果有多个通知,如何进行反击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆