I’m trying to select all the checkbox in list. Why am getting particular checkbox only true. Code is : –
ListView listview = (ListView)findViewById(R.id.listview1);
for(int i=0; i < listview.getChildCount(); i++)
{
AbsoluteLayout itemLayout = (AbsoluteLayout)listview.getChildAt(i);
CheckBox cb = (CheckBox)itemLayout.findViewById(R.id.checkBox1);
if(cb.isChecked())
{
cb.setChecked(false);
}
else
{
cb.setChecked(true);
}
}
Thanks in Advance.
You Can use this with two buttons like
selectall&unselectallHope this will help you.