Problem:
When a notification is selected, Tabs activity is called passing the intent. I want to access the unique notificationId of the notification that was selected in Tabs. I tried intent.putExtra() to save the notificationId in the intent. But, for multiple notifications its overwriting the notificationId and returns the latest one. I dont understand as to why this is happening and how can i avoid this overwriting of notificationId.
Answer:
I got the answer. The intents were getting cached in. To, make a new intent, just add the following piece of code:
intent.setData((Uri.parse("custom://"+System.currentTimeMillis())));
This makes the intent unique.
Also, someone suggested me the following piece of code to make the intent unique:
intent.setAction("actionstring" + System.currentTimeMillis());
It didnt help me, but might be of help to someone else.
分享到:
相关推荐
Notification实现的多媒体播放控制,没有实现具体的播放,只是一个框架。
json2notification - 一个多功能方便好用的notification通知栏通知开源库
Notification 测试程序
这样一个通知就发送成功了,通知栏上也会显示出SmallIcon图标,之后是进行点击通知进行下载处理,首先Notification发送一个Broadcast广播,但是广播里面不能做耗时操作,所以在广播里开启一个Service服务,通过在...
一个多功能方便好用的notification通知栏通知开源库.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
一个小试验,主要说清楚delegate与Notification的区别,及相应的用法
Notification
调用getSystemService(NOTIFICATION_SERVICE)方法获取系统的NotifacationManager服务 通过构造器创建一个Notification对象 为Notification设置各种属性 通过NotificationManager发送Notification。
使用javascript 封装实现 Notification 消息通知框
Notification最新用法、实现Notification的通知栏常驻、Notification的各种样式big View、解决Notification点击无效
小程序源码 notification.zip
本实例描述的Android开发中的Notification通知控件的应用,包括通知的创建、属性设置、跳转方法以及删除等。希望能给学习Notification通知的朋友带来帮助。
4.1创建自定义布局的notification 布局包含progressbar progressbar颜色可以变 自定义progressbar 布局中多个按钮可以点击 动态更新notification中的progressbar
Unity3D中的Notification Center是一个非常重要的组件,它允许GameObject之间相互通信,实现了消息的传递和处理。下面,我们将详细介绍Notification Center的使用和案例说明。 Notification Center的简单使用 ...
示例功能包含普通Notification、折叠式Notification和悬挂式Notification,并且实现了Notification的显示等级。
各种Notification的使用技巧