builder.setTitle(R.string.please_select_loacation);
builder.setSingleChoiceItems(R.array.country, 0,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
String[] rec = getResources().getStringArray(
R.array.country);
location.setText(rec[which]);
}
});
builder.create().show();
转载于:https://my.oschina.net/roderickkennedy/blog/156072