android - Make notification drawer resume app when clicked -
i don't know right term here, when notification launched, on "notification drawer" (the thing pull top of screen , see big list of notifications apps), there app's notification.
i want have app resume when notification clicked. don't see relevant methods in notification builder. still possible?
my code:
private void launchnotification(context context) { string notificationtext = "click resume app!"; notificationcompat.builder notificationbuilder = new notificationcompat.builder(context); notificationbuilder.setsmallicon(r.drawable.notification_small_icon); notificationbuilder.setlargeicon(bitmapfactory.decoderesource(context.getresources(), r.mipmap.ic_launcher)); notificationbuilder.setsound(ringtonemanager.getdefaulturi(ringtonemanager.type_notification)); notificationbuilder.setcontenttext(notificationtext); notificationmanager notificationmanager = (notificationmanager) context.getsystemservice(notification_service); notificationmanager.notify(1, notificationbuilder.build()); }
try this... notification intent can open app directed activity.
intent notificationintent = new intent(context, youractivity.class); pendingintent intent = pendingintent.getactivity(context, 0, notificationintent, 0); notificationbuilder.setcontentintent(intent);
Comments
Post a Comment