Search code examples
androidlistviewcheckedmultiple-choice

How to get to know whether the checkbox is checked or not in a multiple choice listview in android?


I am using multiple choice listview,in this I would am getting the position values when clicked on it.how to know whether it is checked or not.Kindly help me on this.Thanks.


Solution

  • set:

    listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
    

    and check if a particular view from the listView is checked with:

    listView.isItemChecked(i) //i is the position of the view.