开发者

How to save state of Arraylist

开发者 https://www.devze.com 2023-03-16 20:16 出处:网络
I\'m writing a simple todo List application. I am unclear on saving an applications state. İ just need the save state of ArrayL开发者_运维百科ist.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消