mercredi 16 septembre 2015

creating a switch when checkbox is checked

so i am trying to get it to either disable or enable the bool as seen below, when the user checks a checkbox, in my apps UI

/** called when the user clicks the enable checkbox field for enabling Subtraction Problems **/
public void BoolSubProb(View view) {
    if(SubProb = false) {
        SubProb = true;
    }
    else if(SubProb = true) {
        SubProb = false;
    }
}

but i cant seem to get it where it'll only do either enable the bool if its false or disable the bool when its true, when the user has checked the checkbox. it just goes through the loop, and ends up becoming false again.




Aucun commentaire:

Enregistrer un commentaire