android - how to send some data from fragment of one activity to another fragment of another activity -
i have read many links passing data 1 fragment activity or 1 activity other activity's fragment want send fragment of 1 activity other fragment of activity
if have pass datas on application or maybe between far activities/fragment in example, consider using static classes (even if in java there no static classes. it's more static field wrapper).
public class myruntimedatas{ private static string mystringdata; private static int myintdata; //getters , setters }
now, in fragment 1
use
myruntimedatas.setmystringdata("my value"); myruntimedatas.setmyintdata(69);
finally in fragment 2
can call
string mybeautifulstring = myruntimedatas.getmystringdata(); int myfantasticint = myruntimedatas.getmyintdata();
and done
Comments
Post a Comment