?
Solved

maintaining the state of checkboxes on android listviews

Posted on 2012-09-11
5
Medium Priority
?
616 Views
Last Modified: 2012-09-17
Hello Experts,

I am using a listview with checkboxes.

I manually set the the checkboxes.

I want to pre-set the checkboxes again when I come back to the listview.

Please can you give me the command to programatically set the checkboxes when the listview is re-loaded (I know how to store the details of the checkboxes that were checked).

Many Thanks!
0
Comment
Question by:jagku
  • 3
5 Comments
 

Author Comment

by:jagku
ID: 38386739
Thank you.  However, I would like to clarify that I am trying to set the checkboxes that come with a listview. (They are not checkboxes that i have created in a layoutfile)
0
 
LVL 8

Expert Comment

by:Santhana
ID: 38389656
Hi jagku,

Use the
SparseBooleanArray sparseBooleanArray = myList.getCheckedItemPositions();

This method will return the selected state  of the ListView.

Refer this link for some samples...
http://android-coding.blogspot.in/2011/09/listview-with-multiple-choice.html

Regards
Santhana
0
 

Accepted Solution

by:
jagku earned 0 total points
ID: 38391651
Hello,

Thank you for all your responses.
Unfortunately, this hasn't answered the query.

To get this working, I by creating a custom adaptor.

Thanks!
0
 

Author Closing Comment

by:jagku
ID: 38404757
See above answer
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, people trade privacy and security for convenience. However in today's concrete jungle, this is an extremely foolish decision considering the vast amount of technologies being used against consumer interest. First off, I won't waste any time e…
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question