首页 > 移动平台 > 详细

关于Android中new Notification

时间:2016-08-31 00:40:51      阅读:222      评论:0      收藏:0      [点我收藏+]

目前 Android 已经不推荐使用下列方式创建 Notification实例:

1 Notification notification = new Notification(R.drawable.ic_launcher,"This is ticker text",System.currentTimeMillis());

最好采用下列方式:

                Notification notification = new Notification.Builder(this)
                    .setContentTitle("This is title")
                    .setContentText("This is content")
                    .setSmallIcon(R.drawable.ic_launcher)
                        .setTicker("This is ticker")
                        .setContentIntent(pi)
                    .build();
   

 

关于Android中new Notification

原文:http://www.cnblogs.com/itoy/p/5824203.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!