关于setLatestEventInfo(),Builder.getNotification()过时,Android developer提供的原文解决方案:
原出处:
http://onedaysfriend.blog.163.com/blog/static/1026418122014330101814643/
Notification(int icon,
CharSequence tickerText, long when)
This constructor was deprecated in API level 11. Use
意思是该构造方法在API 11就开始不赞成使用,用
Notification.Builder
instead.
Notification.Builder进行替代。
getNotification()
This method was deprecated in API level 16. Use
build()
instead.
意思是该构造方法在API 16就开始不赞成使用,用
进行替代。
至此,我们得到了处理方案,
下面是
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();