samedi 28 avril 2018

Checking the condition of clicking on the checkbox

I have 3 checkboxes on my activity. I need to check status of checkbox(clicked/unclecked), and do specific action based on this result. My logic in this work like:

if(Check1,isCheked) {
//some action
} else if(Check2.isCheked) {
//some action
} else if (Check3.isCheked) {
//some action
} else if ((Check1.isCheked) && (Check2.isCheked)) {
//some action
} else if ((Check1.isCheked) && (Check3.isCheked)) {
//some action
} // etc.

If there are some more rational approach of this, because i, for example, have 9 checkboxes and for their verification, I need 509 conditions?

Aucun commentaire:

Enregistrer un commentaire