This is because its an else if
instead of if
s. Once the first one is satisfied it isn't checking the others. Change the order in which you check these. So something like
if (cb1.isChecked() && cb2.isChecked()) {
a="abc";
}
else if(cb1.isChecked()) {
a="pqr";
}
else if(cb2.isChecked()){
a="asd";
}
else{
a="xyz";
}