hello all i want to remove element when checkbox is unchecked in itemonsetchenge listner.
here is my code
checkbox_timeslot.clear();
chk.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// TODO Auto-generated method stub
String chetimeslot;
if(isChecked){
chetimeslot = (String)chk.getTag();
checkbox_timeslot.add(chetimeslot);
Log.e("array value", ""+checkbox_timeslot);
Log.e("checked slo value", ""+chetimeslot);
}else{
checkbox_timeslot.add("");
Log.e("else array value", ""+checkbox_timeslot);
}
}
});
“checkbox_timeslot” is my string array list.i want to remove the element in checkbox is unchecked and add item when checked from list of checkbox..how is it possible help??
1 Answer