title: Having an issue with Radiogroup in Android
body: <p>I'm facing a trouble with a RadioGroup in Android, I tested everything, but it doesn't seem to work.</p>
  
  <p>Here is my code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    RadioGroup rg = (RadioGroup) findViewById(R.id.radioGroup1);
    setContentView(R.layout.activity_questions);
  titre = (TextView) findViewById(R.id.textView1);
  question = (TextView) findViewById(R.id.textView2);
  image = (ImageView) findViewById(R.id.imageView1);
  rep2 = (RadioButton) findViewById(R.id.radio1);
  rep3 = (RadioButton) findViewById(R.id.radio2);
  rep4 = (RadioButton) findViewById(R.id.radio3);
  count = (TextView) findViewById(R.id.textView4);
  counter = (TextView) findViewById(R.id.textView3);
   count.setText("1/5"); 
    try {
     result =    new RequestTask().execute("http://tv3.orangeadd.com/surveys/current?owner=ofc&amp;user=yasser&amp;category=-1").get();
    } catch (InterruptedException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    } catch (ExecutionException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
    } 
      GsonBuilder gsonb = new GsonBuilder();
          Gson gson = gsonb.create();
          s = new Survey();
      s = gson.fromJson(result,  Surveyentity.class).Survey;
  titre.setText(s.getName());
  question.setText(s.getListquest().get(0).getLabel());
  Picasso.with(Questions.this).load(s.getListquest().get(0).getUrl()).into(image);
  rep1.setText(s.getListquest().get(0).getList().get(0).getLabel());
  rep2.setText(s.getListquest().get(0).getList().get(1).getLabel());
  rep3.setText(s.getListquest().get(0).getList().get(2).getLabel());
  rep4.setText(s.getListquest().get(0).getList().get(3).getLabel());
  
  
  
  
   start = new CountDownTimer(s.getListquest().get(0).getTimeout(), 1000) {
  
      public void onTick(long millisUntilFinished) {
         counter.setText("seconds remaining: " + millisUntilFinished / 1000);
      }
      
   
      public void onFinish() {
          counter.setText("done!");
          prochainequestion();
       }
   }.start();
  
   rg.setOnCheckedChangeListener(new OnCheckedChangeListener() {
  
    
  
       @Override
  
       public void onCheckedChanged(RadioGroup group, int checkedId) {
  
           // find which radio button is selected
  
           if(checkedId == R.id.radio0) {
  
               Toast.makeText(getApplicationContext(), "choice: Silent",
  
                       Toast.LENGTH_SHORT).show();
  
           } else if(checkedId == R.id.radio1) {
  
               Toast.makeText(getApplicationContext(), "choice: Sound",
  
                       Toast.LENGTH_SHORT).show();
  
           } else {
  
               Toast.makeText(getApplicationContext(), "choice: Vibration",
                       Toast.LENGTH_SHORT).show();
  
           }
  
       }
        
  
   });
  
   
   }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      xmlns:android1="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.orange.v1.Questions" &gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/hello_world"
          android:textSize="22sp" /&gt;
  
      &lt;TextView
          android:id="@+id/textView4"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_toRightOf="@+id/imageView1"
          android:text="1/5" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView2"
          android:layout_width="30dp"
          android:layout_height="30dp"
          android:layout_alignLeft="@+id/textView1"
          android:layout_alignTop="@+id/textView3"
          android:src="@drawable/ic_action_time" /&gt;
  
      &lt;TextView
          android:id="@+id/textView3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBaseline="@+id/textView4"
          android:layout_alignBottom="@+id/textView4"
          android:layout_toRightOf="@+id/imageView2"
          android:text="60s" /&gt;
  
      &lt;ImageView
          android:id="@+id/imageView1"
          android:layout_width="180dp"
          android:layout_height="180dp"
          android:layout_below="@+id/textView1"
          android:layout_centerHorizontal="true"
          android:src="@drawable/ic_launcher" /&gt;
  
      &lt;TextView
          android:id="@+id/textView2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/radioGroup1"
          android:layout_below="@+id/imageView1"
          android:text="Question ??????????"
          android:textSize="20sp" /&gt;
  
      &lt;RadioGroup
          android:id="@+id/radioGroup1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/textView2"
          android:layout_marginTop="18dp"
          android:layout_toRightOf="@+id/imageView2" &gt;
  
          &lt;RadioButton
              android:id="@+id/radio0"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:checked="true"
              android:text="RadioButton" /&gt;
  
          &lt;RadioButton
              android:id="@+id/radio1"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="RadioButton" /&gt;
  
          &lt;RadioButton
              android:id="@+id/radio2"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="RadioButton" /&gt;
           &lt;RadioButton
              android:id="@+id/radio3"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="RadioButton" /&gt;
      &lt;/RadioGroup&gt;
  
  &lt;/RelativeLayout&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My code has a lot of things, the problem I'm facing is only with the RadioGroup, I'm having an error launching the activity,</p>
  
  <p>the problem is with the line :  rg.setOnCheckedChangeListener(new OnCheckedChangeListener()</p>
  
  <p>I tested the same code (only of the RadioGroup )on another ActionBarActivity, and it works fine, So what's wrong with this Activity Class ?</p>