DatePickerDialog
suggest changeDatePickerDialog is the simplest way to use DatePicker, because you can show the dialog anywhere in your app. You do not have to build your own layout around a DatePicker.
How to show dialog:
DatePickerDialog datePickerDialog = new DatePickerDialog(context, listener, year, month, day);
datePickerDialog.show();
getDatePicker() returns the DatePicker inside the dialog. You can use it to set a minimum date in milliseconds:
DatePicker datePicker = datePickerDialog.getDatePicker();
datePicker.setMinDate(System.currentTimeMillis());
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents