码迷,mamicode.com
首页 > 移动开发 > 详细

关于Android中new Notification

时间:2016-08-31 00:44:03      阅读:197      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!