android之Notification监听系统清除通知栏
2012-05-15 15:55
477 查看
Notification notification = new Notification(R.drawable.icon, "嘎你妹", System.currentTimeMillis());
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent ii = new Intent();
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, ii, PendingIntent.FLAG_UPDATE_CURRENT);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.defaults = Notification.DEFAULT_SOUND;
Intent i = new Intent("com.android.broadcasttest.xxx");//已有广播
notification.deleteIntent = PendingIntent.getBroadcast(this,
0,i, 0);
notification.setLatestEventInfo(context, "嘎嘎消息",
String.format("共%d条新消息", 1), contentIntent);
nm.notify(R.string.app_name, notification);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent ii = new Intent();
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, ii, PendingIntent.FLAG_UPDATE_CURRENT);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.defaults = Notification.DEFAULT_SOUND;
Intent i = new Intent("com.android.broadcasttest.xxx");//已有广播
notification.deleteIntent = PendingIntent.getBroadcast(this,
0,i, 0);
notification.setLatestEventInfo(context, "嘎嘎消息",
String.format("共%d条新消息", 1), contentIntent);
nm.notify(R.string.app_name, notification);
相关文章推荐
- Android Notification之监听系统清除通知栏方法
- Android系统服务之Notification(通知栏消息)
- Android通知栏监听之NotificationListenerService
- Android系统通知Notification
- Android使用ContentObserver监听数据库变化 接受指定号码的短信,并且不让系统截取到通知用户
- Android 通过系统使用NotificationListenerService 监听各种Notification的用法
- android使用Notification进行通知时有时候通知栏中的项背景是灰白的的,而不是根据手机系统的颜色而定
- 主动通知Android系统刷新文件,并对刷新进度做监听
- Android 通过系统使用NotificationListenerService 监听各种Notification的使用方法
- Android O 8.0系统下通知(Notification)、安装apk问题更新后的简单兼容写法
- Android 自定义Notification通知样式并设置按钮监听.
- Android 监听Notification 被清除实例代码
- android 监听软键盘弹出和隐藏和4.4系统沉浸式通知栏冲突解决
- Android 监听Notification 被清除实例代码
- Android 通过系统使用NotificationListenerService 监听各种Notification的使用方法
- 立即获得下载任务完成的消息通知。Android DownloadManager通过注册一个广播监听系统的广播事件完成此操作,在创建广播时候,需要指明过滤器为:DownloadManager.ACTIO
- 【笔记】Android NotificationListenerService监听短信、来电、微信、QQ等通知消息
- Android使用ContentObserver监听数据库变化,截取系统通知用户接收到短信
- android使用NotificationListenerService监听通知栏消息
- 【Android】监听Notification被清除