Correct way to check all checkboxes in ListView?

后端 未结 4 540
南方客
南方客 2020-12-16 21:59

I have a ListView with set CHOICE_MODE_MULTIPLE. I also have additional header to manage (un)selecting all the items. The question is : is it correct way to do that? Well it

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 22:28

    where Length is array length in the array and chkbox is select all checkbox.

    chkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {

            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                // TODO Auto-generated method stub
                if(chkbox.isChecked())
                {
    
                    for(i=0;i

提交回复
热议问题