Skip to content

Instantly share code, notes, and snippets.

@squm
Created February 13, 2013 06:06
Show Gist options
  • Save squm/4942614 to your computer and use it in GitHub Desktop.
Save squm/4942614 to your computer and use it in GitHub Desktop.
case DIALOG_LIST:
return new AlertDialog.Builder(AlertDialogSamples.this)
.setTitle(R.string.select_dialog)
.setItems(R.array.select_dialog_items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
/* User clicked so do some stuff */
String[] items = getResources().getStringArray(R.array.select_dialog_items);
new AlertDialog.Builder(AlertDialogSamples.this)
.setMessage("You selected: " + which + " , " + items[which])
.show();
}
})
.create();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment