开发者

Unchecking CheckBoxes @ ListView android

开发者 https://www.devze.com 2023-03-07 18:24 出处:网络
how can i uncheck all the CheckBoxes of a ListView? I\'m extending a ArrayAdapter and i\'ve already tried something like:

how can i uncheck all the CheckBoxes of a ListView? I'm extending a ArrayAdapter and i've already tried something like:

private void listCheckBoxesState(boolean select) {
    final ListView list = getListView(开发者_StackOverflow);
    for(int i=0;i<getListAdapter().getCount();i++) {
        list.setItemChecked(i, select);
    }
}

And it doesn't work! :(


Update all of your items and then call notifyDatasetChanged. You can do this in a method inside of your Adapter so it's more transparent for your activity.


have you tried? unchecks it for me on all boxes

for(int i=0;i<getListAdapter().getCount();i++) {
    list.setItemChecked(i, false);
}
0

精彩评论

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