I haven\'t been able to set a Single Choice list, or a Multiple Choice List inside an AlertDialog.
I tried following the examples but I only get a Dialog with a Title, t
this code works for me
final CharSequence[] charSequence = new CharSequence[] {"As Guest","I have account here"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Buy Now")
//.setMessage("You can buy our products without registration too. Enjoy the shopping")
.setSingleChoiceItems(charSequence, 0, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
utility.toast(" "+charSequence);
}
})
.setPositiveButton("Go", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builder.create().show()