@Override protected void onPrepareDialog(int id, Dialog dialog) { switch (id) { case DIALOG_LOCATION: ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>( this, android.R.layout.select_dialog_singlechoice, android.R.id.text1, locationNames); AlertDialog ad = (AlertDialog) dialog; ad.getListView().setAdapter(adapter); break; default: super.onPrepareDialog(id, dialog); } }