Android Radio Button inside Submit Button?
<p>code...</p>

<pre><code>submit.setOnClickListener(new View.OnClickListener() {

   public void onClick(View v) {
      rg.setOnCheckedChangeListener(new OnCheckedChangeListener() {

          public void onCheckedChanged(RadioGroup group, int checkedId) {
            String id = Integer.toString(checkedId);
                DisplayToast(Integer.toString(checkedId));
          }
      });
   }
});
</code></pre>

<p>What i am trying to do is have a user select one of the radio buttons (in rg) and then when they click on submit then the toast is displayed. I think the issue is that the onchecklistener can not be inside another listener...is this possible to do?</p>

<p>The radio buttons are created dynamically and added to rg(radio Group)...</p>

<pre><code>while (cursor.moveToNext()) {    
   rb[i]  = new RadioButton(this);
   rg.addView(rb[i]); 
   rb[i].setText(cursor.getString(1));
   i ++;
}
</code></pre>
