Skip to content Skip to sidebar Skip to footer

Set Selectedvalue In Listview Checkbox In Android

I am using ListView in CheckBox in Android. It is working fine. Now, I want to set Selected Value in CheckBox based on Parameter. So on the loading of the list, if Parameter User i

Solution 1:

You can use setChecked to check the checkbox depends on the value like this

if(country.getUser().equalsIgnoreCase("Yes")){
        holder.checkBox.setChecked(true);
    }
    else {
        holder.checkBox.setChecked(false);
    }

Post a Comment for "Set Selectedvalue In Listview Checkbox In Android"