jeudi 24 août 2017

When I search string selected checkbox counting is display zero

I click on ListView item then checkbox is select and TextView display checked CheckBoxes count. But main problem is when I search string total count become zero. how to solve this problem?

public void getitem(View view) {

    CheckBox checkBox1 = (CheckBox) view.findViewById(R.id.checkbox1);
    checkBox1.getId();
    checkBox1.getTag();

    if (!checkBox1.isChecked() == false) {
        checkBox1.setChecked(false);
    } else {
        checkBox1.setChecked(true);
    }

    int count = 0;
    for (int i = 0; i < filterlist.size(); i++) {
        if (filterlist.get(i).isBox()) {
            count++;
        }
    }
    contactBinding.contactcount.setText(String.valueOf(count));
    adapter.notifyDataSetChanged();
}




Aucun commentaire:

Enregistrer un commentaire