Android, how to redraw list when the user sets checkbox?

丶灬走出姿态 提交于 2019-12-06 15:34:57
Lalit Poptani

You can use setOnCheckedChangeListener to know which checkbox was selected. You can look at complete example of ListView with CheckBox here.

UPDATE

To make your onListItemClick() work you need to write android:focusable="false" for other items of the ListView, its because of the focus of other views ListView's onListItemClick() is not peforming as it should be performing.

Checkout this answer, why Android custom ListView unable to click on items

You probably need to handle the click from the checkbox itself and not just the listview.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!