lundi 10 juillet 2017

Android filterable recyclerview with checkboxes

I am developing an app in which i have recyclerview with checkboxes and a searchview.For searching from edit text i have added

enter image description here

search.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {

            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });

and in afterTextChanged i am changing list and calling notifydatasetChanged()

but state of checkboxes are lost after search.is there any way to keep checkboxes state.

Aucun commentaire:

Enregistrer un commentaire