I added two check box in the on create method
checkBox1 = (CheckBox) findViewById(R.id.checkBox1);
checkBox2 = (CheckBox) findViewById(R.id.checkBox2);
checkBox1.setOnCheckedChangeListener(this) ;
checkBox2.setOnCheckedChangeListener(this) ;
the main function of the check boxes that when ischeck() a picture will be added to the mainlayout and when uncheck the picture will be removed >> I used the code bellow, the first check box is working fine the second check box when I do check it shows the pics and then they I can remove them even with uncheck ... where is the wrong in my code ??
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
if(checkBox1.isChecked())
{
......
mapOverlays.add(custom);
}
else {
mapOverlays.remove(custom) ;
}
if (checkBox2.isChecked())
{
....
mapOverlays.add(custom2);
}
else
{
mapOverlays.remove(custom2) ;
}
}
}