1

I.e. user should be able to choose values from 2 lists (4 options in each). Ideally it should look like drop down lists.

LA_
  • 19,823
  • 58
  • 172
  • 308

1 Answers1

1

So you need two Spinners in a Dialog. OK, wrap spinners with a LinearLayout and use Dialog.setContentView(View) to embed the LinearLayout into the dialog.

The tutorial on this.

Vit Khudenko
  • 28,288
  • 10
  • 63
  • 91
  • Trying to do so and getting error _android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application_, the following code is used: `dialog = new Dialog(getApplicationContext()); dialog.setContentView(R.layout.dialog_subscription); dialog.setTitle("Dialog"); Spinner subQ = (Spinner) dialog.findViewById(R.id.sub_q); ArrayAdapter adapQ = 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); – LA_ Mar 26 '11 at 22:31
  • @LA_: Your code looks OK. Check this - http://stackoverflow.com/questions/1561803/android-progressdialog-show-crashes-with-getapplicationcontext – Vit Khudenko Mar 26 '11 at 22:40
  • Thanks, I've changed `getApplicationContext` to `this` and it started to work. – LA_ Mar 26 '11 at 22:51