android - Calling a function in a currently displayed fragment from Application -
i hav fragment in mainactivity displays loading pic of now, while call function in xmlreader application class mainactivity itself. xmlreader uses asynctask read xml file online server. after execution, need alert fragment shows loading pic refresh else. question how alert displayed fragment? or atleast alert activity can call different fragment.
read somewhere putting broadcast listener overkill, way?
if want access current visible item in viewpager:
// activity int position = mviewpager.getcurrentitem(); fragment currentitem = msectionspageradapter.getitem(position);
if want callback activity fragment:
// call custom method update() in activity fragment ((mainactivity) getactivity()).update();
Comments
Post a Comment