I am trying to create a small list (3 rows) where there are one RadioButton
and one EditText
view on each row arranged horizontally. I want the radiobuttons to be in the same RadioGroup
. I can't add the radio button and the edit text view to a linearlayout because then Android yells about the radiobutton having another parent. How can I solve this?
I am adding each row programatically:
mAnswerGroup.addView(radioButton, new RadioGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
mAnswerGroup.addView(editText, new RadioGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));