How to get data from other activity in android? -


i have 2 activities such activity , b , i'm trying pass 2 different strings b using bundle , startactivity(intent).

like that:

intent intent = new intent(a.this, b.class); bundle bundle = new bundle(); bundle.putstring("vidoedetails", filedetails); //bundle.putstring("videoname", filename);   intent.putextras(bundle); //intent.putextra("videofilename", filename); //intent.putextra("vidoefiledetails", filedetails); startactivity(intent); 

and in class b i'm using 2 textviews display strings class seperately.

like that:

intent = getintent(); bundle extras = i.getextras();  filedetails = extras.getstring("videodetails"); filename = extras.getstring("videoname"); 

the problem filedetils printed in class b not file name.

any solution this?

you have typo:

bundle.putstring("vidoedetails", filedetails); 

should be

bundle.putstring("videodetails", filedetails); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -