android 之Notification
来源:互联网 发布:网络直播打赏经济 编辑:程序博客网 时间:2024/06/16 19:13
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);Intent intent = new Intent(IslogInActivity.this,LogInActivity.class); PendingIntent pendingIntent = PendingIntent.getActivity(context,0,intent,PendingIntent.FLAG_UPDATE_CURRENT); Notification notification; Notification.Builder builder; //Api大于等于HONEYCOMB,使用Notification.Builder创建notification builder = new Notification.Builder(IslogInActivity.this) .setSmallIcon(R.mipmap.point_icon)//图标 .setContentTitle("卫龙卖衣服啦")//标题 .setContentText(getString(R.string.demo))//内容 .setAutoCancel(true)//点击清除 .setContentIntent(pendingIntent)//跳转Activity .setWhen(System.currentTimeMillis()) .setDefaults(Notification.DEFAULT_ALL);//震动,声音等默认效果 notification = builder.build(); notificationManager.notify(1, notification);
参考文章点击打开链接
阅读全文
0 0
- Android 之 Notification
- android之Notification通知
- Android 之 Notification
- android之Notification通知
- Android学习之Notification
- Android之Notification
- android之Notification实现
- Android开发之Notification
- android之Notification通知
- Android之Notification
- Android之基础Notification
- android之Notification通知
- android之Notification通知
- android之Notification通知
- Android之Notification通知
- android之Notification通知
- android之Notification
- android之Notification通知
- 求和
- Android实战SpannableString多行图文混排的应用
- 12个优秀的国外Material Design网站案例
- Trafodion 查看视图定义
- xcode 操作SVN
- android 之Notification
- vs2017 15.5.x dll调试不成功问题
- 数据库锁机制
- 高数 08.06 微分方程习题课 01
- python topN 取 最大的N个数 或 最小的N个数
- word2vec 中的数学原理详解:基于 Negative Sampling 的CBOW和Skip-gram模型
- 大写字母转换成小写字母
- 抓取分支
- 习题7.1