Articles → Android → Timepicker Dialog In Android
Timepicker Dialog In Android
Example
Click to Enlarge
@Nullable
@Override
protected Dialog onCreateDialog(int id) {
return new TimePickerDialog(EditTextDemo.this,
new TimePickerDialog.OnTimeSetListener() {
@Override
public void onTimeSet(TimePicker view, int hourOfDay, int minute) {
TextView txtView = (TextView) findViewById(R.id.tvGetDate);
txtView.setText(hourOfDay + ":" + minute);
}
}, 12, 24, true);
}
Output
Click to Enlarge
Click to Enlarge