I'm implementing a time picker dialog in my project. It should not pick past values with respect to current time. I mean to set minimum and maximum time for picking.
Below is the process for timepicker I have done:
// Current Hour
hour = cal.get(Calendar.HOUR_OF_DAY);
// Current Minute
minute = cal.get(Calendar.MINUTE);
return new TimePickerDialog(this, timePickerListener, hour, minute, false);
I have done the below process to date picker dialog. It worked, but for time picker I can't find any process.
For date picker :
Calendar calendar = Calendar.getInstance();
dialog = new DatePickerDialog(this, onDateSet, cYear, cMonth, cDay);
dialog.getDatePicker().setMinDate(calendar.getTimeInMillis());
So please help how to achieve this in time picker dialog.