开发者

Determine which Checkboxes in a Listview are Checked

开发者 https://www.devze.com 2023-03-04 03:13 出处:网络
I have a listview with checkbox in each 开发者_JAVA百科row. I want to create a new listview when i click in a button with only the cheked items, but I don\'t know how to know which items are selected.

I have a listview with checkbox in each 开发者_JAVA百科row. I want to create a new listview when i click in a button with only the cheked items, but I don't know how to know which items are selected.

Sorry but i don't get to put my row.xml code...


There are few methods available to get the IDs or positions of the checked items:

getCheckedItemPosition () - returns an int with the currently checked item (only good for SINGLE_CHOICE_MODE)

 

getCheckedItemPositions () - returns an int [] with the currently checked items positions

 

getCheckedItemIds () - returns a long [] containing the IDs of the checked items

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号