Dialog alertDialog = new AlertDialog.Builder(this,AlertDialog.THEME_TRADITIONAL) .setTitle(R.string.msg_dialog_title) .setPositiveButton("OK", null) .setNegativeButton("Cancel", null) .setItems(list.toArray(new String[list.size()]), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { et.setText(list.get(which)); et.setSelection(et.getText().length()); } }).create(); alertDialog.show();
The second parameter in Builder(this, AlertDialog.THEME_TRADITIONAL) can set different Theme
AlertDialog.THEME_HOLO_DARK
AlertDialog.THEME_HOLO_LIGHT
The above two are shown in the picture below, respectively dark/light
AlertDialog.THEME_DEVICE_DEFAULT_DARK
AlertDialog.THEME_DEVICE_DEFAULT_LIGHT
The above two are shown in the picture below, respectively dark/light