android - passing params from pending intent -


i need send parameters when user clicks on notification.

my code create notification:

        notificationmanager notifmanager = (notificationmanager) c.getsystemservice(c.notification_service);         notification note = new notification(r.drawable.ic_launcher, "smartdrifter", system.currenttimemillis());            intent wa = new intent(c, webactivity.class);          wa.putextra("url", urltarget);         wa.putextra("valid", notifid);         wa.setflags(intent.flag_activity_new_task);         pendingintent intent = pendingintent.getactivity(c, 0, wa, 0);          notifmanager.cancel(notifid);         note.setlatesteventinfo(c, titulo, texto, teste());            notifmanager.notify(notifid, note); 

my code request params:

string url = getintent().getstringextra("url"); 

but response null.

there form of request parameters?

thanks.

use inbuilt method: onnewintent(intent intent) in activity webactivity catch pending intent.

@override public void onnewintent(intent intent) {      setintent(intent);     string url = getintent().getstringextra("url");  } 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -