android saveinstance saving vector datatypes
I am making an application which is currently working perfectly but with only 1 problem... As we all know that the activity is destroyed and recreated when user changes the orientation of the phone... my activity needs to save a vector full of objects wen the activity is recreated... i checked the OnSaveInstance() method and found that there is no way a vector can be stored... Does any1 have a suggestion for storing vector so that i can retrieve it on recreation of Activity???
Any help will be appreciated...
Yep, there's a mechanism in place for this purpose.
Activityclass, returning the state object you want to persist across orientation changes (in this case, a vector or what not)
- In your
onStartor what not, access the stored object by calling
getLastNonConfigurationInstance. If it's null, recreate the object.