Android - How to reload a fragment on tab selection -
i developed android application action bar 3 tabs , 3 frgments.i need tabs parameter sharedpreferences
, operations on every time tab selected. problem app operations once @ start of application, not know how define every time user select tab, idea?
set index each tab when add tabs action bar this
taba.settag(1); // 1 - first tab
and override ontabselected() method , operations fragment in specific tab
@override public void ontabselected(actionbar.tab tab, fragmenttransaction ft) { int tabindex = (integer)tab.gettag(); // stuff here based not tab id }
Comments
Post a Comment