开发者

Unchecking CheckBoxes @ ListView android

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜