i have made four check boxes. when i check them true it should save in arraylist. Can i save them in array list. and also when i deselect them they should be remove from list or arraylist.i have implemented the check boxes and also one select all button to select all check boxes and one deselect button on deselect all the values of check boxes should be removed from it. My code is.
tv2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String value=tv2.getText().toString().trim();
if (value.equals("Select all")){
abc.setChecked(true);
a.setChecked(true);
b.setChecked(true);
c.setChecked(true);
tv2.setText("Select all");
}
else {
abc.setChecked(false);
b.setChecked(false);
a.setChecked(false);
c.setChecked(false);
tv2.setText("Select all");
}
}
});
}
Aucun commentaire:
Enregistrer un commentaire