Created
April 29, 2017 12:09
-
-
Save smaugho/8817ecad69acc0d741a21b76286ec73b to your computer and use it in GitHub Desktop.
Action Selectors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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