I am a new developer for Android and searching about how to save custom object as persistent data. How can I save an object and restore it ?
I've researched several methods such as o开发者_StackOverflow中文版nSaveInstanceState and onRestoreInstanceState. But there is no method to save Vector/Object/. And I couldn't know how to save when it is on runtime.
Can you suggest me sample code ?
Thanks in advance.
You can do it.
Check up the Data storage section of Dev Guide doc. There provides several ways of saving data persistently. It`s easy to learn.
By the way, onSaveInstanceState and onRestoreInstanceState is not way of saving persistent data, the data is operated merely in mem.
精彩评论