Skip to content Skip to sidebar Skip to footer

Listfragment Is Empty After Going Back

I have a simple activity built with HoloEverywhere with one fragment container. ListFragment appears there on start, and appears normally. Then, click on list item replaces ListFra

Solution 1:

When you replace your fragment, I think that the onDestroyView() method is called. You can use transaction.hide(this) instead :

        ft.addToBackStack(null);
        ft.hide(this);
        ft.add(R.id.frag_frame, lyrics);
        ft.commit();

or set your list adapter in the onResume() method, when your fragment is back to foreground, the onResume will be called.

Solution 2:

Implementing onsaveInstanceSate() method may resole your issue?

Post a Comment for "Listfragment Is Empty After Going Back"