Android ListView with Checkbox: automatically unchecks

后端 未结 2 1609
再見小時候
再見小時候 2021-01-02 22:01

I\'ve got a ListView with a custom BaseAdapter. The list items contain CheckBoxes that need to represent a property from a database.

I use CheckBox.setOnCheckedChang

2条回答
  •  青春惊慌失措
    2021-01-02 22:34

    Use a boolean array to store the checked state of each list item, record the changes inside setOnCheckedChangeListener(), then call setChecked() after setOnCheckedChangeListener().

提交回复
热议问题