0
我已創建兩個單選按鈕:Java的Android的 - 單選按鈕沒有顯示
- 首先,藍牙
- 其次,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! – KostasC
對不起,但我沒有XML。目標是在alertdialog中添加兩個RadioButton。當用戶點擊項目菜單時,會顯示alertdialog。 – McNavy