expandablelistview - Android : what happens when I re-launch my app after a long break -
i'm developing app main activity 3 tab actionbar. 1 of tabs handles expandablelistview want indicator stay on right, in mainactivity got :
public void onwindowfocuschanged(boolean hasfocus) { super.onwindowfocuschanged(hasfocus); if (tab != null){ lv.setindicatorrightfunction(); //sets indicator on right side } }
my problem sometimes, function not called , indicator remains left! added setindicatorrightfunction() in onresume() , seemed work fine when app onpause().
the problem when go afk while, or switches on multiple other apps on phone. then, when relaunch app, indicator appears on left side ! setindicatorrightfunction() not called! there method can call solve problem ? doing wrong ?
edit :
i figured out function wasn't called because tab equals null. why ? how can solve ?
@override public fragment getitem(int position) { // getitem called instantiate fragment given page. switch (position) { case 0: tab = new tabfragment(); return tab; } }
aren't there onresume() functions-like fragments ? solution can see, call setindicator function when fragments resumed/...