lundi 4 janvier 2016

IsChcked() doesn't response to the Checkbox state (android studio)

Hi I have 2 checkbox(cb1,cb2), I set default values to the Checkbox cb1.setchecked(true),cb2.setchecked(false). Then I set an onclick listener to cb2. in the the onclick method (in the click listener) I wrote : cb2.SetChecked(true) cb1.SetChecked(false) . The problem is that by visibility it's working, the cb2 is checked and the cb1 unchecked But when I check the Checkbox state by boolean state=cb2.IsChecked() It return me false and cb1.IsChecked() return me true altough it's the opposite(by visibility) . The I concluded that it's only takes the default values that I set to the Checkbox And the click listener only effect that in the visibility mode but not the programming mode

What should I do? Thanks!!




Aucun commentaire:

Enregistrer un commentaire