title: Radio Group and radio buttons
body: <p>I need to implement a multiple choice question. I have to add radio buttons and text view for multiple choice. I need to implement it dynamically corresponding to the number of choices. Can someone help me</p>
  
  <pre><code>for (Answer answer : answers) {
      LinearLayout linearLayoutRw2 = new LinearLayout(this);
      linearLayoutRw2
              .setLayoutParams(new LinearLayout.LayoutParams(
                      LayoutParams.MATCH_PARENT,
                      LayoutParams.WRAP_CONTENT));
  
      RadioGroup radioGroup = new RadioGroup(
              ShowQuestionsActivity.this);
      linearLayoutRw2.addView(radioGroup);
  
      RadioButton rb = new RadioButton(ShowQuestionsActivity.this);
      radioGroup.addView(rb);
  
      TextView ansText = new TextView(ShowQuestionsActivity.this);
      ansText.setText(Html.fromHtml(answer.getAnswerText()));
      linearLayoutRw2.addView(ansText);
  
      linearLayoutShowQues.addView(linearLayoutRw2);
  
  }
  </code></pre>