android - Passing data between fragment in tabhost -


i create tabhost 2 fragment

 mtabhost = (fragmenttabhost)rootview.findviewbyid(r.id.tabhost1);     mtabhost.setup(getactivity(), getchildfragmentmanager(), r.id.tabcontent1);      mtabhost.addtab(mtabhost.newtabspec("fragmentb").setindicator("stations"), ligne11tram.class, null);     mtabhost.addtab(mtabhost.newtabspec("fragmentc").setindicator("info trafic"), infotrafictram.class, null); 

i want send data first fragment(ligne11tram) 2nd fragment (infotrafic) , please can tell me how do

well passing info between fragments on same activity, easiest method calling function in acitivity 1st , passing info second.

kind of on first fragment.

((activityclass) getactivity()).functonwithvaraiblestopasstosecond(variables); 

in activity class

pubic void functonwithvaraiblestopasstosecond(variables) {      secondfragment.funcitontoacceptvariables(varaibles); } 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -