android - Fragment Transaction Commit: State Loss in OnClick? -


i still dont seem state loss error when commiting fragment. have listview onclicklistener:

public void onlistitemclick(listview l, view v, int position, long id) {     switch (position) {         case 0:            fragmenttabactivity.addfragments(maintabhostactivity.gettabnames()[0], new openerlocationlistfragment(), true);            break;     } } 

and addfragments method:

    public void addfragments(string tabname, fragment fragment, boolean add) {     if (add) {         hmaptabs.get(tabname).add(fragment);     }      fragmentmanager manager = getsupportfragmentmanager();     fragmenttransaction ft = manager.begintransaction();      ft.replace(android.r.id.tabcontent, fragment);     ft.commit(); } 

how can lose state in short time frame? can understand why happens in asynctasks should different here (other allowing state loss)? has suggestions?


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

java - Two interface have same method name with different return type -

javascript - Linking from page A to a specific iframe on page B -