title: setChecked and setSelected not working android radio button
body: <p>I'm trying to get the selected value from radio button when my variable idAnswerP is equal to answers.get(i). When i debug on my app, shows the number i receive in idRespuestaC but it doesnt display in radio button. Help?</p>
  
  <pre><code>public void addRB(ArrayList&lt;Model&gt; answers) {
      RadioGroup ll = new RadioGroup(this);
      ll.setOrientation(LinearLayout.VERTICAL);
  
      for (int i = 0; i &lt; answers.size(); i++) {
          Model model = answers.get(i);
          RadioButton radiob = new RadioButton(this);
  
          if (idAnswerP == model.getId()) {
              radiob.setId(model.getId());
              radiob.setText(model.getQuestion());
              radiob.setTag(model.getAnswer());
              radiob.setChecked(true);
              radiob.setSelected(true);
          } else {
              radiob.setId(model.getId());
              radiob.setText(model.getQuestion());
              radiob.setTag(model.getAnswer());
              radiob.setChecked(false);
          }
  
          lisRadio.add(radiob);
          ll.addView(radiob);
      }
  
      ((ViewGroup) findViewById(R.id.radioGroup)).addView(ll);
  }
  </code></pre>