samedi 13 octobre 2018

toast msg went crazy for my checkbox validation

I want to create a validation for the checkbox. For example, if the provider does not check one of the checkboxes, it will issue a Toast msg, "Please tick at least one of your selections."

My interface:-

enter image description here

My coding:-

else if(!(cbBM.isChecked()) || !(cbBI.isChecked()) || !(cbMath.isChecked()) || !(cbSc.isChecked()))
    {
        Toast.makeText(getActivity(), "Please tick at least one of your selections.", Toast.LENGTH_SHORT).show();
    }

The problem I faced was, the toast message always display if I did not tick the "Bahasa Melayu" option.




Aucun commentaire:

Enregistrer un commentaire