If you want to use checkboxes for this, you can set an onItemClickListener on both the checkboxes and need to unselect other in the onItemClick() Method. An example would be like this:-
CheckBox cb1,cb2;
//Considering you can initialize the above variables
cb1.setOnCheckedChangeListener(new OnCheckedChangeListener{
onCheckedChanged (CompoundButton view, boolean isChecked){
cb2.setChecked(false);
}
});
cb2.setOnCheckedChangeListener(new OnCheckedChangeListener{
onCheckedChanged (CompoundButton view, boolean isChecked){
cb1.setChecked(false);
}
});
I would reccomend that you should use radio buttons for this behavior since they come with this functionality built in from the beginning.