Notification的简单使用
来源:互联网 发布:360软件修补漏洞 编辑:程序博客网 时间:2024/06/05 15:26
Notification是Android中通知栏内容的控件,我们可以使用Notification在通知栏显示要提示给用户的消息。
下面是一段简单的代码
private static final int NOTIFICATION_ID = 1; //NOTIFICATION_ID是用来标识Notification的 NotificationCompat.Builder builder = new NotificationCompat.Builder(MainActivity.this); //使用builder来创建Notification builder.setSmallIcon(R.mipmap.ic_launcher); //设置图标 builder.setContentTitle("新消息"); builder.setContentText("这是你收到的新消息的内容"); Notification notification = builder.build(); //创建Notification对象 NotificationManager manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); manager.notify(NOTIFICATION_ID,notification);
0 0
- notification的简单使用
- Notification的简单使用
- Notification的简单使用
- 简单而使用的NOTIFICATION
- Notification(通知)的简单使用
- Notification 最简单的使用
- Notification的使用简单的介绍
- Android学习之Notification的简单使用
- Notification.builder的简单使用√
- Android API- Notification(通知)的简单使用
- android 三种notification 的简单使用
- Notification 简单使用
- android简单实例-----------5种Notification的简单使用
- 简单的Notification
- Notification的简单用法
- Android Notification 通知 简单使用
- Android中通知(Notification)的简单使用
- Android---60---Notification 通知栏的简单使用
- 丁耘:开发者是打通最后一公里的决定性力量
- (Advanced Receiver Autonomous Integrity Monitoring 高级接收机自主完好性监测——词汇
- 最小长方形
- easyui DataGrid editors扩展之combogrid ,combogrid 下拉选择后填充 editor 列内容方法
- 汉诺塔
- Notification的简单使用
- xp系统Java 7环境变量配置及eclipse使用
- 用程序来控制一个网页,实现自动输入等操作
- @Override标签
- Python学习笔记___初识Python
- 小游戏------锅打灰太狼
- SlidingTabColors——viewpager和自定义导航栏
- HDFS写数据过程
- interrupted() 和 isInterrupted() 的区别