When my activity is ran for the first time it downloads some url strings and sets them to.
a String list…
public String [] myRemoteImages = {imageUrl,imageUrl2,imageUrl3,imageUrl4};
the imageUrl’s inside are 4 url’s that are downloaded and set to the variables..
When the activity is closed or destroyed, how can i save these url’s to their variables so they wont be erased when the activity is destroyed?
Could i possible save it in a bundle and then onRestoreInstanceState pull them out?
If you want to save these strings during activity re-creation use the following method.
If you want to keep these string alive when your application is closed by user you’d better use
SharedPreferences.onRestoreInstanceState()is called when the activity is restored. It means that this activity is recreating after configuration change or after a process containing this activity was killed and re-launched. So if you want to save a state before your app closes, useonPause()/onResume()methods to save and restore it.