简体   繁体   中英

Save State of a Multiple choice ListView

Can someone instruct me how to save the state of the checkbox's of a multiple choice listview? i'm trying to save the state into a database but it could also be done using shared preferences, i think.

my regards.

Two months on this problem? Yikes!

The first approach that occurs to me is to save a comma-separated text string of the checked index positions. On retrieval, you can split the string at the commas and parse the int values into an int array to recover the indexes, and then use that for whatever you need (restoring checked states, processing the checked items, whatever).

为什么不将布尔值存储为整数或文本存储在数据库中,而只是将它们转换为插入/提取方法呢?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM