title: Android: How do I enable/disable a Checkbox, depending on a Radio button being selected first
body: <p>Basically I have a Radio Group with two radio buttons, one of them is labelled RUN and the other is labelled PASS.
  Just underneath this I also have a check-box labelled "Pass Complete"</p>
  
  <p>Question: How do I disable the check-box when RUN radio button is selected (so the checkbox can't be selected) and enable it while the PASS radio button is selected?
  Any help constructing some type of IF statement would be much appreciated.</p>
  
  <p>XML</p>
  
  <pre><code>&lt;RadioGroup
  android:id="@+id/runandpass"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" 
  androidrientation="horizontal"&gt;
  
  &lt;RadioButton
  android:id="@+id/radiobuttonrun"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:checked="true"
  android:text="RUN" android:layout_weight="50"/&gt;
  
  &lt;RadioButton
  android:id="@+id/radiobuttonpass"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="PASS" 
  android:layout_weight="50"/&gt;
  &lt;/RadioGroup&gt;
  
  &lt;LinearLayout
  android:layout_width="fill_parent"
  android:layout_height="wrap_content" 
  androidrientation="horizontal"&gt;
  
  &lt;TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_weight="50"
  android:text="" /&gt;
  
  &lt;CheckBox
  android:id="@+id/checkBoxcmpltpass"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="Pass Complete" 
  android:layout_weight="6"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>JAVA</p>
  
  <pre><code>package com.aces.acesfootballuk;
  
  import android.app.Activity;
  import android.os.Bundle;
  
  public class CoachesPage extends Activity{
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
  // TODO Auto-generated method stub
  super.onCreate(savedInstanceState);
  setContentView(R.layout.coachespage);
  
  
  }
  };
  </code></pre>