How to give counter if more than one Notifications are there

后端 未结 4 1310
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 10:03

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 me

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-19 10:35

    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 
    

    here is the link

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

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

    Android Notification Bar Number

提交回复
热议问题