How to save state of Arraylist
I'm writing a simple todo List application. I am unclear on saving an applications state. İ just need the save state of ArrayL开发者_运维百科ist.
ArrayList<CheckBox> alCheckbox = new ArrayList<CheckBox>();
i tried to override onSaveInstanceState method. But i cant.
How can i save the state of ArrayList.
Thanks.
onSaveInstanceState is meant to be used for application restarts. For instance when the user changes the orientation on the screen. You want a permanent storage solution for data that should persist the application being launched, stopped, killed, etc... For a more permanent solution like SharedPreferences, Internal/External Storage, or SQLite Databases. Here's the tutorial on Data Storage options.
精彩评论