title: radiobutton not showing correct checked id
body: <p>i have to check simentaneously one one radiobutton and see the value of timeone if ab1 is clicked through toast.. , how can i see it .. i am using is "rab"+number of radiobutton.ischecked() method. is it ok or anyother method should be used ?</p>
  
  <pre><code>public class Alarmsettings extends Activity {
  RadioButton rab1,rab2,rab3,rab0;
  RadioGroup rg;
  Button ab1,ab2;
  public  Integer timeone;
  public Alarmsettings()
  {
  
  }
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.second_layout);
     rab0=(RadioButton) findViewById(R.id.radio0);
      rab1=(RadioButton) findViewById(R.id.radio1);
      rab2=(RadioButton) findViewById(R.id.radio2);
      rab3=(RadioButton) findViewById(R.id.radio3);
          ab1=(Button) findViewById(R.id.button1);
          ab2=(Button) findViewById(R.id.button2);
          rg = (RadioGroup) findViewById(R.id.radioGroup1);
  
          if(rab0.isChecked())
              timeone=15;
  else    if(rab1.isChecked())
  timeone=30;
  
  
  else    if(rab2.isSelected())
              timeone=45;
  else    if(rab3.isChecked())
              timeone=60;
  
  
          ab1.setOnClickListener(new OnClickListener() {
  
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
  
  
              Toast.makeText(getApplicationContext(),timeone.toString(), Toast.LENGTH_SHORT).show();
  </code></pre>