I have a date picker that allows a user to select a date, by default this lets you change the year higher and higher to infinite or something, but I want to confine the user to a maximum year. Such as only 2 years from now.
new DatePickerDialog(this, mDateSetListener, mYear, mMonth, mDay)
How do I set the max date within that function? I’m sure I can do a “if date > 2014 , then show a toast message and show the datepicker again until they select a proper date” but I would prefer to just not let the date picker function go above a certain year.
Insight appreciated!
Add a OnDateChangedListener to DatePicker Object and then override the
Hope this helps