android - Can not convert from Notification.builder to Notification -



android - Can not convert from Notification.builder to Notification -

im having problems whole notification , notificationcompat stories, im using api 11, , im trying add together style() notification, code:

notification noti = new notification.builder() .setcontenttitle("5 new mails " + sender.tostring()) .setcontenttext(subject) .setsmallicon(r.drawable.new_mail) .setlargeicon(abitmap) .setstyle(new notification.inboxstyle() .addline(str1) .addline(str2) .setcontenttitle("") .setsummarytext("+3 more")) .build();

this extact code developer.android has suggested @ site, when paste in own codes, says can not convert notification.builder notification. tried utilize notificationcompat seems method setstyle, undefined notificationcompat , or atleast mine says so, there way can manage this? or there compability library supports notification.setstyle() api 11? thanks

use notificationcompat.builder instead. can phone call setstyle() no matter project's api level (of course, if device doesn't back upwards styles, part ignored).

note: you're missing context parameter in builder's constructor -- necessary both native notification.builder , notificationcompat.builder.

android

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -