the-blue-alliance/the-blue-alliance-android — pull request #48 by nwalters512 (2014-05-10 21:11:03+00:00)
Title: Save fragment state upon view recreation

This is the beginning of proper fragment state saving! This doesn't apply to orientation changes yet, but it is useful for ````ViewPager```s, which is where most of our fragments live. When the fragment is paused, the list adapter, which at this point has hopefully been loaded, and the ```ListView```'s state are cached. When ```onCreateView(...)``` is called after you swipe away from the fragment and then come back, the fragment checks if an adapter exists and sends it to the ListView if it does. If it does not exist, the adapter is recreated and we proceed as we normally do.

This does not yet account for orientation changes. That would require a different strategy as we are guaranteed to never have an existing adapter. That would require saving the list's state in ```onSaveInstanceState(...)```, retreiving it in ```onCreate(...)```, and then restoring it to the``` ListVeiw``` once the ```ListView``` is constructed. We'll probably want to add a callback to the ```AsyncTask```s so that they can let their hosting activity know once the view has been created so that they can restore the state.