android Notification知识总结
2016-05-09 15:57
399 查看
一个通知的步骤 Notification.Builder builder=new Notification.Builder(MainActivity.this); // builder.setLa Intent intent=new Intent(MainActivity.this,Main2Activity.class); PendingIntent pendingIntent=PendingIntent.getActivity(MainActivity.this,0,intent,0); builder.setSmallIcon(R.mipmap.ic_launcher); builder.setContentIntent(pendingIntent); builder.setAutoCancel(true); builder.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.mipmap.ic_launcher)); builder.setContentTitle("this is test"); builder.setContentText("this is test2"); NotificationManager notificationManager= (NotificationManager) getSystemService(NOTIFICATION_SERVICE); notificationManager.notify(1,builder.build());
相关文章推荐
- android Intent机制详解
- Android 实现一键切换应用主题颜色
- Android通过Get方式提交数据的乱码处理
- Android 沉浸式状态栏攻略 让你的状态栏变色吧
- Android SDK更新下载所有版本
- android基础总结篇之七:ContentProvider之读写短消息
- Android自定义Button背景色,弧度
- Android 高清加载巨图方案 拒绝压缩图片
- android图片压缩终极解决方案
- Snmp学习总结(二)——SNMP4J介绍
- android 无线调试
- Android限定符使用【初级】
- 对 Android 开发者有益的 40 条优化建议
- AndroidStudio 分享项目到 git
- AndroidManifest.xml官方介绍
- Android游戏编程笔记(二)
- 15 个 Android 通用流行框架大全
- Android开发之多级下拉列表菜单实现(仿美团,淘宝等)
- Android截屏
- Android Studio --基础介绍之Gradle详解