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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -