【发布时间】:2017-05-24 15:56:39
【问题描述】:
我创建了两个单选按钮:
- 首先,蓝牙
- 其次,用于 RS232
但我的应用程序只显示其中一个。
这是我的代码:
final RadioButton Bluetooth = new RadioButton(this);
Bluetooth.setId(TEXT_ID);
alertDialogBuilder.setView(Bluetooth);
Bluetooth.setText("Bluetooth");
Bluetooth.setTextSize(20);
final RadioButton RS232 = new RadioButton(this);
RS232.setId(TEXT_ID);
alertDialogBuilder.setView(RS232);
RS232.setText("RS232");
RS232.setTextSize(20);
【问题讨论】:
-
请也分享您的布局xml!
-
抱歉,我没有 XML。目的是在警报对话框中添加两个 RadioButton。当用户单击项目菜单时会显示警报对话框。
标签: java android radio-button