Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to implement a "checkbox group" (like RadioButton group) in android?

I'm developing a quiz-like app in android. Each question is a recycler view item so that I can have multiple question types presented sequentially. My question is: is there any way of implementing a CheckBox group just like the RadioButton group? With the RadioButton group, I'm able to add answers (RadioButton's) by simply calling:

RadioGroup radioGroup = view.findViewById(R.id.answer_grp);
RadioButton rb = new RadioButton("context...");
rb.setText("text");
radioGroup.addView(rb);

Is there any implementation of a Checkbox group similar to this? Should I use the implementation of the RadioButton group provided and customize the layout of the RadioButton to look like a checkbox? What's the best possible practice in this case?

Thanks very much in advance!

Radio button group I'm using

like image 693
Poider12 Avatar asked Jan 21 '26 23:01

Poider12


1 Answers

You can try this library https://github.com/xeoh/CheckBoxGroup

Hope this helps!

like image 173
SonhnLab Avatar answered Jan 23 '26 13:01

SonhnLab



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!