I have a Google's NavigationDrawer
which adds/replaces fragments
. One of fragments
has a listView
filled with custom BaseAdapter
by network request (asyncTask
, takes times). What i want is to save listView
contents somewhere so if user navigates to another fragment through navigationDrawer
and then or later navigates back to the fragment
containing listView
- i want a listView
to be populated immediately with saved old content before asyncTask finished loading new content. Minimum API is 10.
What did i try.
onSaveInstanceState
- serializeParcelable ArrayList<CustomObject>
. Somehow i didn't get it working. Also, that isn't solving my problem however, because onSaveInstaceState doesn't triggers on navigating through navigationDrawer.Setting new fragment's
InitialState(setInitialSavedState)
thensaving(saveFragmentInstanceSate)
/loading it. That works for simple Views like EditTexts and TextView, but didn't get it working for the listView.
What is a best way to save listView contents? Please help me.