How to create alert dialog that I can select date of birth:
I want that it's not be impossible to choose date in future.
How could set limits in date dialog Here is my code
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case DATE_DIALOG_ID:
final Calendar calendar = Calendar.getInstance();
int yy = calendar.get(Calendar.YEAR);
int mm = calendar.get(Calendar.MONTH);
int dd = calendar.get(Calendar.DATE);
return new DatePickerDialog(this, mDatePickerListener, yy, mm, dd);
}
return null;
}
Just add this
dialog.getDatePicker().setMaxDate(new Date().getTime());