-1
Может кто-нибудь сказать мне, где я делаю ошибку? Почему оба RadioButtos можно выбрать, даже если я поместил их в RadioGroup?Как создать RadioButtons динамически
Вот код:
final Dialog dialog = new Dialog(context);
LinearLayout ll = new LinearLayout(context);
ll.setOrientation(LinearLayout.VERTICAL);
dialog.setTitle("Title");
RadioButton rb_yes = new RadioButton(context);
rb_yes.setText("yes");
RadioButton rb_no = new RadioButton(context);
rb_no.setText("no");
rb_no.setChecked(true);
RadioGroup radioGroup = new RadioGroup(context);
radioGroup.setOrientation(RadioGroup.VERTICAL);
radioGroup.addView(rb_yes);
radioGroup.addView(rb_no);
ll.addView(radioGroup);
// "context" I've already created before (Context context = this)
_____________thank вас – ioann