How to uncheck checkbox when limit is exceeded in android?

Hello, I'm new to Android, my requirement allows the user to check a maximum of 3 number of checkboxes. when the user tries to verify that the fourth should fill in the dailogue. I try, but the fourth problem does not cancel ...

can someone help me ...

Relations Shiva.M

+4
source share
1 answer

Uncheck the box using the following code block:

final CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox_id); if (checkBox.isChecked()) { checkBox.setChecked(false); } 
+11
source

Source: https://habr.com/ru/post/1338984/


All Articles