Skip to content

Instantly share code, notes, and snippets.

@smaugho
Last active May 3, 2017 13:42
Show Gist options
  • Save smaugho/67aa9858f90e499c7893b747d9cda061 to your computer and use it in GitHub Desktop.
Save smaugho/67aa9858f90e499c7893b747d9cda061 to your computer and use it in GitHub Desktop.
Actions handling Future Results
@Click
void sendInformation() {
int informationType = getInformationType();
$Toast("The information type index is {informationType}");
}
int getInformationType() {
String[] types= {"Type 1", "Type 2", "Type 3"}
$AlertDialog().items(types).negativeButton("Cancel");
if ($AlertDialog.ItemSelected) {
int $position = 0;
return position;
}
return $Future.Int;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment