-1
Good night,
In my app, I need to select a total of 2 Checkbox boxes. After selecting 2 boxes, all others should be set with setEnabled(false).
So far so good, but how will I know which box was selected, WITHOUT KNOWING which box the user choose, and how will I simply give a setEnabled(false) in all others?
The logic would be like:
if(duasCheckBoxQualquer.isClick(){
todasAsOutrasCheckBox.setEnabled(false)
If anyone can help me, I’d appreciate it.
Thanks for the answer! I’m doing it this way anyway, I’ll test and tell you.
– Biscoitinho
Yeah, that’s right, he selects two boxes and disables them all. I figured that would happen. The problem now is how to make all, except the selected, be disabled.
– Biscoitinho
Condition the boxes before disabled...
– GusCorreia
If(checkBox1.isChecked()) { //not disable } get it? It will definitely work
– GusCorreia
If the answer has been solved, mark it as correct :)
– GusCorreia
I hope I’ve helped
– GusCorreia
You gave me an idea... I made the selection equal to 2, and cleared all Checkboxes. Correct. After that, the chosen Checkbox receives a setEnabled(true). This did not work :c
– Biscoitinho
Yes, we are going:)
– GusCorreia