how to limit checkbox selection in listview?

前端 未结 5 1278
暖寄归人
暖寄归人 2020-12-30 17:35

friends,

i want to limit checkbox selection in android listivew to for example only 3 checkboxes should be selected otherwise it should give error message.

u

5条回答
  •  一个人的身影
    2020-12-30 18:05

    Take a static int count variable and increment it using these condition

    holder.checkBox.isChecked() if it is true then increment in the count then check count>3 then show popup to user

    I hope this is Help.

提交回复
热议问题