开发者

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

开发者 https://www.devze.com 2023-02-09 23:26 出处:网络
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.

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


Just uncheck the checkbox using the following code block:

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

精彩评论

暂无评论...
验证码 换一张
取 消