Radio button in android?
         

> In my android application am using 4 radio buttons. I need get Selected data from radio button.It automatically selects where it is clicked before clicking the button. 

        
         
           rgp1.setOnCheckedChangeListener(new OnCheckedChangeListener() {
           public void onCheckedChanged(RadioGroup group, int checkedId) { 
            // RadioButton radioButton = (RadioButton) findViewById(checkedId);
             //Toast.makeText(QuiztestActivity.this, "" + quesarray, 2000).show(); 
             counter++;
             if(counter >= 10 || counter >= quesarray.size() ) {
            	 Toast.makeText(QuiztestActivity.this, "" + score, 2000).show();
            	 return;
             }
             
            quen.setText(quesarray.get(counter));
            anss1.setText(anss1array.get(counter));
         	anss2.setText(anss2array.get(counter));
         	anss3.setText(anss3array.get(counter));
         	anss4.setText(anss4array.get(counter));
         	
         	Toast.makeText(QuiztestActivity.this, "" + anssarray.get(counter), 2000).show();
         	
         	RadioButton radioButton = (RadioButton) findViewById(checkedId);
         	String ans = (String) radioButton.getText();
         	Toast.makeText(QuiztestActivity.this, "" + ans, 2000).show();
         	if (ans == anssarray.get(counter));
            score= score + 1 ;
         }
        });
    }
   
Radio button in android?
===

         

> In my android application am using 4 radio buttons. I need get Selected data from radio button.It automatically selects where it is clicked before clicking the button. 

        
         
           rgp1.setOnCheckedChangeListener(new OnCheckedChangeListener() {
           public void onCheckedChanged(RadioGroup group, int checkedId) { 
            // RadioButton radioButton = (RadioButton) findViewById(checkedId);
             //Toast.makeText(QuiztestActivity.this, "" + quesarray, 2000).show(); 
             counter++;
             if(counter >= 10 || counter >= quesarray.size() ) {
            	 Toast.makeText(QuiztestActivity.this, "" + score, 2000).show();
            	 return;
             }
             
            quen.setText(quesarray.get(counter));
            anss1.setText(anss1array.get(counter));
         	anss2.setText(anss2array.get(counter));
         	anss3.setText(anss3array.get(counter));
         	anss4.setText(anss4array.get(counter));
         	
         	Toast.makeText(QuiztestActivity.this, "" + anssarray.get(counter), 2000).show();
         	
         	RadioButton radioButton = (RadioButton) findViewById(checkedId);
         	String ans = (String) radioButton.getText();
         	Toast.makeText(QuiztestActivity.this, "" + ans, 2000).show();
         	if (ans == anssarray.get(counter));
            score= score + 1 ;
         }
        });
    }
   