To prevent a WebView from reloading, add the following android:configChanges attribute as part of the WebView Activity declaration in your application AndroidManifest.xml file.
For the ListView, there were 4 code changes needed.
1. In the ListAdapters, add a method to access the data used by the Adapter.
public ArrayList... getItems()
2. Override the onRetainNonConfigurationInstance() method in the ListActivity classes to get the data from the ListAdapter.
public Object onRetainNonConfigurationInstance()
3. Override the onSaveInstanceState() method in the ListActivity classes. The method caches the data for the next instance of the ListActivity.
protected void onSaveInstanceState(Bundle outState)
4. In the ListActivity onCreate() method, add this code, which checks to see if there is existing data before loading it again.
content = (ArrayList...)ContentCache.getObject(storedKey);
if(content==null && savedInstanceState != null)
content = (ArrayList...)savedInstanceState.getSerializable(storedKey);
if(content == null)
//no previous data, so RSS feed must be read
//reuse existing feed data
adapter = new LensesAdapter(currentContext, content);
I had to modify the ArrayList declarations because Blogger is wanting to close the