Do checkboxes have the permission to behave like radio buttons.I am developing a quiz application where in the options have the behaviour of radio buttons and the icon of the options are to be like the checkbox and is it possible for me to group the checkbox as we group radio buttons?
Do checkboxes have the permission to behave like radio buttons.I am developing a quiz
Share
I don’t know if this is the best solution but you can create a “manager” for your checkboxes, and run it whenever any of them gets clicked.
For simplicity I’ve added the manager in the xml code, but feel free to use setOnClickListener, or setOnCheckedChangeListener as well.
You need an ArrayList to iterate through, so you can settle the status of each checkbox, whenever any of them gets clicked on.
And here we have our manager, one iterator to pass trough the whole list, unchecking everything, when it reaches the clicked one, checks!
I also could find this other solution linked below, you can change the theme of your checkbox, but I dont have any experience on themes, so I can’t help you any further on this approach.
Is it possible to change the radio button icon in an android radio button group