Skip to content

Instantly share code, notes, and snippets.

@smaugho
Created May 3, 2017 13:03
Show Gist options
  • Save smaugho/9227f8f59c6b91d06ad61a0573d55493 to your computer and use it in GitHub Desktop.
Save smaugho/9227f8f59c6b91d06ad61a0573d55493 to your computer and use it in GitHub Desktop.
$DateDialog and $TimeDialog Actions
void selectDate() {
$DateDialog();
int $year = 0, $month = 0, $day = 0;
String selectedDate = String.format(Locale.US, "Selected date is %02d-%02d-%02d", $year , $month+1, $day);
$Toast(selectedDate);
}
void selectTime() {
$TimeDialog();
int $hour = 0, $minute = 0;
String selectdTime = String.format(Locale.US, "Selected time is %02d:%02d", $hour, $minute);
$Toast(selectedTime);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment