android - How to display some details (Content Text, Content Info and Small Icon) in expanded notifications -
android - How to display some details (Content Text, Content Info and Small Icon) in expanded notifications -
i created notification using code below:
// prepare intent triggered if notification selected intent intent = new intent(this, notificationreceiveractivity.class); intent.setclass(this, notificationreceiveractivity.class); pendingintent pintent = pendingintent.getactivity(this, 0, intent, 0); notificationmanager notificationmanager = (notificationmanager) getsystemservice(notification_service); notificationcompat.builder builder = new notificationcompat.builder(getapplicationcontext()); long[] vibrationpattern = {0, 200, 800, 200, 600, 200, 400, 200, 200, 200, 100, 200, 50, 200, 50, 200, 50, 200, 50, 200}; notificationcompat.inboxstyle inboxstyle = new notificationcompat.inboxstyle(); inboxstyle.setbigcontenttitle("notif title"); inboxstyle.addline("one "); inboxstyle.addline("two"); inboxstyle.addline("three"); inboxstyle.addline("four"); inboxstyle.addline("five"); inboxstyle.addline("six"); inboxstyle.addline("seven"); notification notification = builder .setsmallicon(r.drawable.ic_launcher) .setcontenttitle("notif title") .setcontenttext("notif text") .setautocancel(true) .setcontentintent(pintent) .setlargeicon(bitmapfactory.decoderesource(getresources(), r.drawable.email)) .setsmallicon(r.drawable.email) .setcontentinfo("notif content info") .setwhen(calendar.getinstance().gettimeinmillis() + 1000*60+60) .setvibrate(vibrationpattern) .setstyle(inboxstyle) .setcontenttext("notif text") .build(); notificationmanager.notify(mynotificationid , notification);
and works... but: possible display fields 3, 4 , 5 attached image (in expanded notification, not in contracted one)? ( took image from: http://developer.xamarin.com/guides/cross-platform/application_fundamentals/notifications/android/local_notifications_in_android/)
android notifications expand
Comments
Post a Comment