Skip to content

Instantly share code, notes, and snippets.

@smaugho
Created April 29, 2017 12:09
Show Gist options
  • Save smaugho/8817ecad69acc0d741a21b76286ec73b to your computer and use it in GitHub Desktop.
Save smaugho/8817ecad69acc0d741a21b76286ec73b to your computer and use it in GitHub Desktop.
Action Selectors
@Click
void selectAction() {
String[] actions = {"Action 1", "Action 2", "Action 3"}
$AlertDialog().items(actions)
.positiveButton("More Actions")
.negativeButton("Cancel");
if ($AlertDialog.ItemSelected) {
$Toast("Action selected was {actions[position]}");
}
if ($AlertDialog.PositiveButtonPressed) {
$MoreActionsActivity();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment