2011-03-26 25 views

回答

1

所以你需要兩個SpinnersDialog。好的,將旋轉器換成LinearLayout,然後使用Dialog.setContentView(View)LinearLayout嵌入到對話框中。

對這個tutorial

+0

試圖這樣做,並獲取錯誤_android.view.WindowManager $ BadTokenException:無法添加窗口 - 標記null不是爲application_,使用以下代碼:'dialog = new Dialog(getApplicationContext()); dialog.setContentView(R.layout.dialog_subscription); dialog.setTitle(「Dialog」); Spinner subQ =(Spinner)dialog.findViewById(R.id.sub_q); ArrayAdapter adapterQ = ArrayAdapter.createFromResource(this,R.array.sub_q_array,android.R.layout.simple_spinner_item); adapQ.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); subQ.setAdapter(adapQ); – 2011-03-26 22:31:50

+0

@LA_:您的代碼看起來不錯。檢查這個 - http://stackoverflow.com/questions/1561803/android-progressdialog-show-crashes-with-getapplicationcontext – 2011-03-26 22:40:26

+0

謝謝,我已經改變了'getApplicationContext'到'this',它開始工作。 – 2011-03-26 22:51:46