vendredi 28 août 2015

IF condition not working with Android CheckBox

if ((Problem != null && !notokcheckbox.isChecked()) || (Problem!=null && !ressolvedcheckbox.isChecked())) {
    Toast.makeText(getActivity(), "Enable Ok Or Not/Ok", 100000).show();
} else {    
    Toast.makeText(getActivity(), "Sucess", 100000).show();
}

I am trying to apply validation I have two check Box notokcheckbox and ressolvedcheckbox.

if Problem != null and nither notokcheckbox, ressolvedcheckbox is not checked then it should display Enable Ok Or Not/Ok

or

if Problem != null or either notokcheckbox or ressolvedcheckbox is enable then it should Print Sucess.

while I am trying it with single check Box i mean its working fine but not with both.

Can u please tell me how to apply with two check Box:

if (Problem != null && !notokcheckbox.isChecked()) {
    Toast.makeText(getActivity(), "Enable Ok Or Not/Ok", 100000).show();
} else {
    Toast.makeText(getActivity(), "Sucess", 100000).show();
}

working fine.

please suggest me how to fix it.




Aucun commentaire:

Enregistrer un commentaire