I have an application Activity
that in onCreate
loads an XML file from a service using an AsyncTask
. The XML is parsed into an ArrayList
. When I switch to a different activity and then back to the main activity, I want to be able to recognize that that XML file was already loaded and use the populated ArrayList
.
What is the best way to persist that ArrayList
?
onSaveInstanceState
only seems to support primitives and I've been unable to set up a case where onRetainNonConfigurationInstance
actually gets called. So in onCreate
, the XML data is loaded from the server ever time I switch to that Activity
. I have made the models that are in the ArrayList
implement Parcelable
, so could use that in some way?