mardi 18 février 2020

How to select all checkboxes, while clicking the main checkbox in android?

I need selecting the main checkbox, the all other partial checkboxes also selected

 selectAllCheckbox.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                CheckBox cb = (CheckBox) view;
                isPartial = true;
                splitItemAdapter.selectAllItem(cb.isChecked());
                if (isFromCashPayment) {
                    if (cb.isChecked()) {
                      selectAllCheckbox.setChecked(true);
                      isitemChecked = true;




                    } else {

                        selectAllCheckbox.setChecked(false);

                        isitemChecked = false;



                    }
                }
            }
        });



Aucun commentaire:

Enregistrer un commentaire