您的位置:首页 > 产品设计 > UI/UE

setLatestEventInfo(),Builder.getNotification()过时,Android提供的解决方案

2015-11-01 20:05 525 查看
关于setLatestEventInfo(),Builder.getNotification()过时,Android developer提供的原文解决方案:

Notification(int
icon, CharSequence tickerText, long when)

This constructor was deprecated in API level 11. Use
Notification.Builder
instead.
意思是该构造方法在API 11就开始不赞成使用,用
Notification.Builder进行替代。


getNotification()


This method was deprecated in API level 16. Use
build()
instead.

意思是该构造方法在API 16就开始不赞成使用,用


build()

进行替代。

至此,我们得到了处理方案,
下面是
Android
developer给出的一段demo:

Example:
Notification noti = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.build();


原出处:http://onedaysfriend.blog.163.com/blog/static/1026418122014330101814643/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: