android - NotificationCompat not grouping notifications -
i'm trying group notifications apparently keep coming separately.
notificationmanager mnotificationmanager = (notificationmanager) this.getsystemservice(context.notification_service); intent resultintent = new intent(this, splashscreenbaseactivity.class); resultintent.putextra(arguments.arg_notification_type, news_type); taskstackbuilder stackbuilder = taskstackbuilder.create(this); stackbuilder.addnextintent(resultintent); pendingintent resultpendingintent = stackbuilder.getpendingintent( 0, pendingintent.flag_update_current ); notificationcompat.builder mbuilder = new notificationcompat.builder(this) .setsmallicon(r.drawable.ic_launcher_small) .setlargeicon(bitmapfactory.decoderesource(getresources(), r.mipmap.ic_launcher)) .setcontenttitle(contenttitle) .setcontenttext(contenttext) .setautocancel(true) .setgroup(news_group) .setgroupsummary(true) .setdefaults(-1); mbuilder.setcontentintent(resultpendingintent); random random = new random(); notification_id = random.nextint(9999 - 1000) + 1000; mnotificationmanager.notify(notification_id, mbuilder.build());
Comments
Post a Comment