假如现在通知栏中有许多个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访问webservice参数传递失败,求大神指导
- android 竖着的进度条ProgressBar(急急急急急急急急急)
- 仅使用android SDK,不用NDK能否进行android的串口通信开发
- 各位,网页数据返回太多!后面的内容被省略了怎么办??
- 请教高手~~~~~~~~~~~~~~~~~~~~~
- 如何杀死占用端口的进程
- 如何让一个Activity区别于其它的,以便让Intent能直接启动
- 导入别人写的项目作为lib出不明错误
- android获取服务器xml文件出错?
- 服务器客户端分时传递字符串和文件
- webview 显示网页中的flash遮盖其他组件问题
- 我的Android程序在模拟器上面能正常运行部署到真机上面总是步显示?
notify(int,Notification)的第一个参数是对应的通知id,可以设置不同的id对应不同的notification。