android - Fragment Communication - selecting tabs and running methods in other tabs (Fragments) -
i have implemented tabbed action bar using android fragments (not support package). have button on 1 of tabs when pressed calls method in parent activity using interface.
the method in parent activity function change selected tab (fragment) , call method in tab.
i have interface allows 1 of fragments call method in parent activity
@override public void onchangetabbuttonselected(string billingid) { int position = 1; // selects 2nd tab getactionbar().setselectednavigationitem(position); ((fragmenttabsearchclients) searchclientstab).getclients(billingid); }
this works fine , tab changed , method called appears fragment lifecycle has not been initiated correctly has method called getclients
uses `getview()' returns null.
in parent class there way initialise tab before calling method on tab?
Comments
Post a Comment