Can I use onSaveInstanceState for saving all my transient states?
Yes, that function is meant for it.
You should not use it for saving very large objects as it might take time to serialize and de-serialize it.
option 2 is true, so use it only for saving small transient states.
none of the above.
onSaveInstanceState() function has to be used for saving small objects (transient states). If we want to save large objects use onRetainNonConfigurationInstance() function.
Back To Top