假如现在通知栏中有许多个Notification,如何才可以知道用户最终点击打开的是哪个通知??? Notification notification = new Notification(
R.drawable.notification_icon, "标题",
System.currentTimeMillis());
Intent intent = new Intent(
"com.activity.MyActivity");
// 每次附加的内容不同
intent.putExtra("content", "A");
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(this, "通知标题", "通知内容", pendingIntent);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(1, notification);
// 以上是其中我写的代码片段,因为每次我发的通知,其中intent中附加的内容不同。所以我想每次得到用户点击的那个通知上的不同的内容
R.drawable.notification_icon, "标题",
System.currentTimeMillis());
Intent intent = new Intent(
"com.activity.MyActivity");
// 每次附加的内容不同
intent.putExtra("content", "A");
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(this, "通知标题", "通知内容", pendingIntent);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(1, notification);
// 以上是其中我写的代码片段,因为每次我发的通知,其中intent中附加的内容不同。所以我想每次得到用户点击的那个通知上的不同的内容
解决方案 »
- 第一天学习Android 怎么见不了工程?
- 关于用videoview播放rtsp流的问题
- android中我想在第三方软件中设置音效,我想选择系统自带的,怎么弄?
- cygwin下repo下载 android出错!!刚开始玩,请大家指教!
- 请教 android4.0中,so文件的使用。
- 请教:Android播放RTSP的错误Error(100,0)
- Android 消息机制
- 怎么修改系统的系统时间?就是每次刷机的时候系统的默认时间就是2011.01.01
- 字符串 backString.equals("0") 为何为false
- 为什么在layout_gravity中center_horizontal不生效, 而center却可以?
- webview 显示网页中的flash遮盖其他组件问题
- 我的Android程序在模拟器上面能正常运行部署到真机上面总是步显示?
notify(int,Notification)的第一个参数是对应的通知id,可以设置不同的id对应不同的notification。