Wednesday, January 16, 2013

populate alertdialog with array


Alertdialog popup with list values:

final CharSequence[] digitList = {"1", "2", "3","4","5","6" };
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Select");
builder.setSingleChoiceItems(digitList, -1, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
editest.setText(digitList[which].toString());
dialog.dismiss();
}
});
builder.create();
builder.show();

No comments:

Post a Comment