在做一个应用的时候用到一个notification通知,可是当点击了notification之后,这个notification仍然还在,这里做个记录:
Intent intent = new Intent(HelperMain.this,Calllog.class);//要跳转的activity
PendingIntent pendingIntent = PendingIntent.getActivity(HelperMain.this, 0, intent, 0);
mNotification = new Notification();
mNotification.icon = android.R.drawable.ic_dialog_info;
mNotification.tickerText = missedCall;
// mNotification.defaults = Notification.DEFAULT_SOUND;
mNotification.flags |= Notification.FLAG_AUTO_CANCEL;//这里就是可以自动在点击之后消失关键
mNotification.setLatestEventInfo(HelperMain.this, "未接来电", "未接来电", pendingIntent);
//执行notification
mNotificationManager.notify(12313, mNotification);
分享到:
相关推荐
android notification完全解析Demo
主要利用了notification service 和receiver 实现了用户通知栏更新,失败了点击重新下载,下载好了点击自动安装,布局很丑,请根据自己项目的实际需求自行修改
Notification显示音乐下载的界面
类型:NotificationDemo 功能:从网上下载apk存储到手机指定目录,并在通知栏里显示其下载进度,如果下载错误,或者不想要该apk可以删除 涉及知识: 文件流、网络下载链接协议、读写权限、Handler、Notification、...
Android Notification 常见样式代码及发送demo,其中包含源码及一个app-release.apk,可直接发送固定样式,也可自定义样式。可以作为通知测试的小工具,也可作为参考demo。
这个项目整合了Android平台所有Notification的使用方法,有些使用场景不生效,不知道是否是我使用方法有问题。
Android Notification消息框 Toast弹出框用法演示范例,本例中关于 Toast弹出框的演示,演示了适时的 Toast和长时间的 Toast,关于Notification的定义,则演示了高级Notification的用法,自定义4种Notification的...
android Notification
android notification 软件更新
android notification Service 文件下载
android 利用notification 通知栏 实现动态下载.
Android notification进度条 demo,欢迎下载!!!!!!!!!!!!!!!!!!!!!!!!!!!!
android notification 通知 源码 例子
Android NOtification 使用Android NOtification 使用
Convert JSON to Android Notification. This is very useful for push notification (GCM). Usage Notification notification = Json2Notification.from(context).with(json).notification(); NotificationManager ...
简单介绍Android Notification用法 详细介绍NotificationManageService和StatusBarManageService与App层交互过程
了解Android Notification的基本用法
Android Notification通知 简单使用 demo下载。 解决问题:兼容高低版本,帮助用户打开通知开关,android5.x手机状态栏icon是白块问题。 详细文章请参考 ...
各种各样的android Notification效果
kinds of notification