android - How to show a dialog when click on notification -
i notification in application through broadcastreceiver, question , how can parse data activity , make dialog received data ?
this code when click on notification , nothing happens :
notificationmanager notificationmanager = (notificationmanager) ctx.getsystemservice(context.notification_service); intent notificationintent = new intent(intent.action_view); notificationintent.setdata(uri.parse(link)); pendingintent pending = pendingintent.getactivity(ctx, 0, notificationintent, intent.flag_activity_new_task); notification mynotification = new notificationcompat.builder(ctx) .setsmallicon(r.drawable.ic_launcher).setautocancel(false).setlargeicon(remote_picture) .setcontenttitle(onvan).setstyle(new notificationcompat.bigtextstyle().bigtext(msg)) .setcontenttext(msg).setcontentintent(pending).build(); notificationmanager.notify(1, mynotification);
i've variablese link , msg, onvan contains data , need send these variables activity , make dialog .
how can ?
you can send data notification activity
using method putextra
, put this
pendingintent pending = pendingintent.getactivity(ctx, 0, notificationintent, pendingintent.flag_cancel_current));
inplace of this
pendingintent pending = pendingintent.getactivity(ctx, 0, notificationintent, intent.flag_activity_new_task);`
Comments
Post a Comment