问题描述
我已经使用GCM推送通知到我的应用程序。一切安好。
当我得到通知,当我点击我的通知可以移动其他activity.I想过去网址链接到另一个activity.but,如何处理点击多个通知。
下面,当我得到通知5,然后点击我移动到其他活动的任何通知但我传递的环节是第一个通知的URL说。我使用不同的通知ID
NotificationManager notificationManager =(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(X
/ *通知ID * /
,notificationBuilder.build());
创建的PendingIntent时使用PendingIntent.FLAG_UPDATE_CURRENT。
又路过意图的PendingIntent其设置不同的行动之前,每次。例如: -
intent.setAction(Long.toString(System.currentTimeMillis的()));
I have used GCM Push Notifications into my app. Everything is fine.
When i get notification and when i click notification I can move other activity.I am passing url link to another activity.but,How to handle click on multiple notifications.
Here say when I get 5 notifications and click on any notification I am moving to other activity but the link which I am passing is the first notification url. I am using different notification id
NotificationManager notificationManager =
(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(x
/*ID of notification */
, notificationBuilder.build());
use PendingIntent.FLAG_UPDATE_CURRENT when creating PendingIntent.
Also before passing intent to PendingIntent set its action different everytime. e.g.:-
intent.setAction(Long.toString(System.currentTimeMillis()));
这篇关于如何处理不同GCM点击的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!