Save image in onsaveinstatncestate: A heavy image downloaded from internet in onCreate() of an activity. Is it possible to save it in onsaveinstancestate() in case of configurationChanges?
no, we have to save it in onPause()
no, we have to use some static reference to it.
no, we don't need to save it at all.
Generally configuration changes causes activity to get destroyed and recreated. So if you have downloaded heavy image from internet in onCreate() function, then there is a chance that it will be re downloaded in onCreate() one more time if user rotates the phone. To avoid this we can have a static reference to that image to avoid multiple downloads.
Back To Top