I wanted to get this list without the radio button. After digging a bit in AlertDialog.Builder & AlertController.AlertParams I found the solution: instead of using setSingleChoiceItems use setAdapter.
ArrayAdapteradapter = new ArrayAdapter (this, android.R.layout.select_dialog_item, itemActionsList);
dialog.setAdapter(adapter,
new OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int arg1) {
// Do something
arg0.dismiss();
}
});
2 comments:
But then, android.R.layout.select_dialog_item is wrong, should be android.R.layout.simple_list_item_1
Thanks bro.
Post a Comment