Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uncheck the CheckBox, when limit exceeds in android?

Tags:

android

Hello I am New to Android, My requirement is allow the user to check maximum 3 number of checkboxes. when user is trying to check fourth one should populate dailogue. Iam trying but the problem is fourth one is not unchecking...

can any one help me...

Regards Shiva.M

like image 934
shiva Avatar asked Dec 22 '22 18:12

shiva


1 Answers

Just uncheck the checkbox using the following code block:

     final CheckBox checkBox = (CheckBox) findViewById(R.id.checkbox_id);
     if (checkBox.isChecked()) {
         checkBox.setChecked(false);
     }
like image 189
Md. Masud Iqbal Avatar answered Feb 25 '23 06:02

Md. Masud Iqbal