android - can not read extra from intent when app startup from notification -


i using fcm receive messages , on onmessagereceived have code

notificationmanager notificationmanager = (notificationmanager) getapplicationcontext().getsystemservice(service.notification_service);             intent notifyintent = new intent(this,hellobubblesactivity.class);             notifyintent.putextra("id",sender);             notifyintent.addflags(intent.flag_activity_new_task |                 intent.flag_activity_single_top);             pendingintent pendingintent = pendingintent.getactivity(getapplicationcontext(), 0, notifyintent, pendingintent.flag_cancel_current);               notificationcompat.builder mbuilder =                     new notificationcompat.builder(this)                             .setcontenttitle("new message " + name)                             .setsmallicon(r.drawable.smalllogo)                             .setautocancel(false)                             .setcontenttext(text)                             .setcontentintent(pendingintent);             notificationmanager.notify(sender, mbuilder.build()); 

when app opening notification have problem getting -1 code here

int chatid = getintent().getintextra("id",-1);  

did miss thing ?

insure activity not singleinstance enable. time problème singleinstance activity


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -