Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Last active December 10, 2019 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magdamiu/9c68c60199c5abe52439e93afb13e8a4 to your computer and use it in GitHub Desktop.
Save magdamiu/9c68c60199c5abe52439e93afb13e8a4 to your computer and use it in GitHub Desktop.
TimePickerDialog example
hour = c.get(Calendar.HOUR_OF_DAY);
minute = c.get(Calendar.MINUTE);
TimePickerDialog timePickerDialog = new TimePickerDialog(this,
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay,
int minute) {
textViewDateTime.setText(hourOfDay + ":" + minute);
}
}, hour, minute, false);
timePickerDialog.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment