title: Android: How to get text of dynamically created radio button selected by the user?
body: <p>How can i retrieve the text of a dynamically created radio button 
  selected by the user? Here's my code: </p>
  
  <pre><code>RadioGroup radiogroup = (RadioGroup) findViewById(R.id.rdbGp1); 
          // layout params to use when adding each radio button 
          LinearLayout.LayoutParams layoutParams = new 
  RadioGroup.LayoutParams( 
                  RadioGroup.LayoutParams.WRAP_CONTENT, 
                  RadioGroup.LayoutParams.WRAP_CONTENT); 
   for (int i = 0; i &lt; 4; i++){ 
              final RadioButton newRadioButton = new RadioButton(this); 
              c3 = db.getAns(3); 
          for (int j=0;j&lt;i;j++) 
              c3.moveToNext(); 
             label = c3.getString(0); 
          newRadioButton.setText(label); 
          newRadioButton.setId(6); 
          radiogroup.addView(newRadioButton, layoutParams); 
  </code></pre>
  
  <p>Waiting for the reply, 
  Maqsood</p>