Using `onRetainCustomNonConfigurationInstance` to retain data across configuration changes <p>I've been programming for Android for some time, and I'm still looking for solutions to retain data over configuration changes. Aside from saving <code>Parcelable</code>s to Activity's <code>Bundle</code> in <code>onSaveInstanceState</code> docs are suggesting using <code>Fragment</code> with <code>setRetainInstance</code> flag set to true.</p> <p>But I've just come across some code that uses <code>onRetainCustomNonConfigurationInstance</code> to hold arbitrary objects (in a fancy way, but essentially big objects without references to <code>Activity</code> etc.). I have never seen this method used, so I have some doubts:</p> <ul> <li>Is this method safe to call to store arbitrary objects (in a sense that I can be pretty sure it's gonna get called, and that it won't be deprecated/removed anytime soon)?</li> <li>How is this method different from <code>onRetainNonConfigurationInstance()</code>, which also should return <code>Object</code>, and in essence should work similarly?</li> <li>Is using retained fragment still better, for some reason?</li> </ul> <p>As a bonus, I would be grateful for any other tips or solutions to save state of objects like <code>AsyncTask</code>, <code>Observable</code>, view's presenters and go on</p>