title: Android Radio Button
body: <p>I have a radio button group in Android which looks something like:</p>
  
  <p>Choose Color:</p>
  
  <ul>
  <li>Red</li>
  <li>Blue</li>
  <li>Orange</li>
  <li>Green</li>
  </ul>
  
  <p>I need to get selected radio button and also its value. </p>
  
  <p>I have 4 radiobuttons in this manner within radiogroup <code>rg</code></p>
  
  <pre><code>rb1a=(RadioButton)findViewById(R.id.rb1a);
  rb1b=(RadioButton)findViewById(R.id.rb1b);
  rb1c=(RadioButton)findViewById(R.id.rb1c);
  rb1d=(RadioButton)findViewById(R.id.rb1d);
  tv1=(TextView)findViewById(R.id.tv1);
  next1=(Button)findViewById(R.id.next1);
  rg=(RadioGroup)findViewById(R.id.rg);
  
  // I have error after this line.please help
  rg.setOnCheckedChangeListener(new OnCheckedChangeListener()
  {
      public void onCheckedChanged(RadioGroup group, int checkedId)
      {
  
      }
  
      @Override
      public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
          // TODO Auto-generated method stub
  
      }
  });
  </code></pre>