Set Limit on the DatePickerDialog in Android?
How to limit on DatePickerDialog to choose a date from 2-12 years in the past or from 0-2 years from the current date? I have DatePickerDialog in activity which is used for getting the date of birth for child and infant. Child age will be (2-12yrs) and infant age can be (0-2ys). If I pass 1 then the age limit should be (2-12yrs) and if I pass 2 the age limit should be (0-2yrs). What could I do to get this functionality in my calendar? My Calender code is: date = new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth