Android中在通知栏内常驻应用程序消息
来源:互联网 发布:程序员最讨厌几阿哥 编辑:程序博客网 时间:2024/06/05 05:44
http://leybreeze.com/blog/?p=1480
说明:通过 setNotification() 可以在通知栏中添加一条常驻通知,通过 cancelNotification() 取消该通知。
// 添加常驻通知private void setNotification() { NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); Notification notification = new Notification(R.drawable.icon, getString(R.string.app_name), System.currentTimeMillis()); Intent intent = new Intent(this, Sample.class); notification.flags = Notification.FLAG_ONGOING_EVENT; // 设置常驻 Flag PendingIntent contextIntent = PendingIntent.getActivity(this, 0, intent, 0); notification.setLatestEventInfo(getApplicationContext(), getString(R.string.app_name), getString(R.string.information), contextIntent); notificationManager.notify(R.string.app_name, notification);} // 取消通知private void cancelNotification() { NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); notificationManager.cancel(R.string.app_name);}
说明:通过 setNotification() 可以在通知栏中添加一条常驻通知,通过 cancelNotification() 取消该通知。
- Android中在通知栏内常驻应用程序消息
- Android中添加常驻通知栏
- android常驻通知栏
- Android高仿UC浏览器和360手机卫士消息常驻栏(通知栏)
- Android高仿UC浏览器和360手机卫士消息常驻栏(通知栏)
- android常驻通知栏的实现
- 通知栏Notification和常驻通知栏
- Android 通知栏消息
- Android 通知栏消息
- android 通知栏消息
- android通知栏区分多通知消息
- android通知栏的消息通知(Notification)
- 常驻通知栏跳转到别的应用
- android中如何隐藏应用程序标题栏和通知栏
- android中如何隐藏应用程序标题栏和通知栏
- Android消息通知栏应用
- android的消息通知栏
- Android消息通知栏开发
- openfire开发文档
- 获得母版页的控件的值
- Oracle Flashback
- [openGL]分格化
- 读取配置文件
- Android中在通知栏内常驻应用程序消息
- makefile shell 函数
- linux下调试方法-GDB
- android的各种布局
- 基于开源jabber(XMPP)/Openfire架设企业内部即时通讯服务方案
- 微信公众平台 开放平台 自定义回复和事件推送代码
- 使用proguard混淆library库
- mysql TIMESTAMP(时间戳)详解
- android如何让service不被杀死