When my application became sophisticated and main activity started holding in memory a lot of data (loaded and parsed from files in response to user actions) I have (mistakenly) switched from onSaveInstanceState to onRetainNonConfigurationInstance without noticing that onRetainNonConfigurationInstance is not called when application is killed to save device memory. So as now I has to switch back to onSaveInstanceState I want to as what is the proper way to handle a huge amount of data distributed by tens of objects? Do I have to implement serialization for all these objects (Parcelable?) or may be put all the data into Service thread hoping it would not be killed? What is the best practice?
When my application became sophisticated and main activity started holding in memory a lot
Share
I’ve ended with an ugly but the only acceptable solution:
Applicationobject.Serviceso that application object will not be killed even if all activities are killed.