У меня проблема с моими радиообменами, потому что она показывает группу радио в myLayout, а не в alertDialog, я пытался это сделать, но я не могу понять, как это сделать, потому что я совершенно новый в андроиде.Radiobuttons with alertDialog
View myView = getLayoutInflater().inflate(R.layout.radiogroup, null);
setContentView(myView);
RadioGroup myRadioGroup = (RadioGroup)
myView.findViewById(R.id.radioGroup);
int radioGroupId = myRadioGroup.getCheckedRadioButtonId();
RadioButton myCheckedButton = (RadioButton)
myView.findViewById(radioGroupId);
int index = myRadioGroup.indexOfChild(myCheckedButton);
new AlertDialog.Builder(this)
.setMessage("Choose Startup Color:")
.setPositiveButton("Set Startup Color", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
}
})
.show();
Вы забыли оставить свой код. Если вы можете опубликовать свой код, мы сможем вам помочь. – MilesDyson
Я добавлял все детали: P – jaimito