mardi 14 juillet 2020

Making checkbox selected if scan a particular item in Recyclerview android

I have got list of data from server in an array and there is a scan button, on scan tap i pass a tag. To all the matching tags, the checkbox should get checked. For now it is checking only last one.

Below is the code

 public void checkTag(String tag) {


    for (int i = 0 ;i <receiptList.size();i++)
    {
        if (tagList.get(i).contains(tag))
        {
            checkBox.setChecked(true);

        }
        else
        {
            checkBox.setChecked(false);
        }
    }



Aucun commentaire:

Enregistrer un commentaire