RadioGroup inside an AlertDialog : only single RadioButton shown
<p>I'm trying to set up a RadioGroup inside an AlertDialog. I'm using the following construct for that.</p>

<pre><code>new AlertDialog.Builder(this)
            .setTitle("Set icon for " + item_cursor.getString(1))
            .setView(radioGroupView)
            .setPositiveButton("Ok",
                    new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog,
                        int whichButton) {
                    RadioGroup radioGroup = (RadioGroup) findViewById(R.id.radiogroup);
                    int checkedRadioButton = 0;
                    try {
                        checkedRadioButton = radioGroup.getCheckedRadioButtonId();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    int i =0;
                    switch (checkedRadioButton) {
                    case R.id.a2s :
                    datasource.updateIcon(i,itemid);
                    break;
                    case R.id.android: i=1;
                    datasource.updateIcon(i,itemid);
                    break;
                    }
                }
            }).setNegativeButton("Cancel",
            new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog,
                        int whichButton) {
                    // Canceled.
                }
            }).show();
</code></pre>

<p>But the alertDialog only shows one Radiobutton. Following is the XML seticon.xml :</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:orientation="vertical"&gt;
    &lt;RadioGroup android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:orientation="horizontal"
        android:id="@+id/radiogroup"&gt;
        &lt;RadioButton android:id="@+id/android"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:text="Android" /&gt;
        &lt;RadioButton android:id="@+id/a2s" android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:text="Argen2Stone ROM" /&gt;
    &lt;/RadioGroup&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>Why does this happen?</p>
