I am not able to display a view inside alertdialog.new AlertDialog.Builder(this)
.setTitle("Set preferences for ")
.setView(findViewById(R.layout.radiodialog1))
.show();
And the radiodialog1 bring `
<RadioButton
android:id="@+id/radioNum"
style="@style/RadioButtonAppTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="btnNumbersClicked"
android:text="@string/PlayNumbers" />
<RadioButton
android:id="@+id/radioFour"
style="@style/RadioButtonAppTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="btnStart4LetterClicked"
android:text="@string/btn4LetterText" />
<RadioButton
android:id="@+id/radioFive"
style="@style/RadioButtonAppTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="btnStart5LetterClicked"
android:text="@string/btn5LetterText" />
</RadioGroup>
`
The dialog displays with just the title that is set.. I tried placing this radio group inside a linearlayout. Works fine when setContentView for an activity. Can anyone help?
you should use either,
or Create View by LayoutInflater, and then inflate view from layoutinflater service, then set that view to dialog, by Dialog.setView() method.