title: RadioGroup: How to check programmatically
body: <p>I create a RadioGroup from XML</p>
  
  <pre><code>    &lt;RadioGroup android:id="@+id/option" 
          android:layout_width="match_parent"
          android:orientation="horizontal" 
          android:checkedButton="@+id/block_scenario_off"
          android:layout_height="wrap_content"&gt;
          &lt;RadioButton 
              android:layout_width="0dip"
              android:layout_weight="1" 
              android:text="@string/option1" 
              android:layout_height="wrap_content" 
              android:id="@+id/option1"
              android:layout_gravity="center|left" 
              android:onClick="@string/on_click"/&gt;
          &lt;RadioButton 
              android:layout_width="0dip"
              android:layout_weight="1" 
              android:text="@string/option2" 
              android:onClick="@string/on_click"
              android:layout_height="wrap_content"
              android:layout_gravity="center" 
              android:id="@+id/option2"/&gt;
          &lt;RadioButton 
              android:layout_width="0dip"
              android:layout_weight="1" 
              android:text="@string/option3"
              android:onClick="@string/on_click" 
              android:layout_height="wrap_content"
              android:layout_gravity="center|right" 
              android:id="@+id/option3" /&gt;
      &lt;/RadioGroup&gt;
  </code></pre>
  
  <p>In Java code, I programmatically check the first one on activity creation (onCreate()) as following:</p>
  
  <pre><code>    mOption = (RadioGroup) findViewById(R.id.option);
      mOption.check(R.id.option1);
  </code></pre>
  
  <p>But when the activity is shown, no radio button is checked. Any help?</p>