I have datepickerdialog like this:
birthDateDialog = new DatePickerDialog(AddGrave.this, R.style.datePickerStyle, birthDateDialogListener,
birthCalendar.get(Calendar.YEAR),
birthCalendar.get(Calendar.MONTH),
birthCalendar.get(Calendar.DAY_OF_MONTH));
birthDateDialog.show();
and style:
<style name="datePickerStyle" parent="AppTheme">
<item name="android:endYear">2200</item>
<item name="android:startYear">1000</item>
</style>
It works properly on android 4.x, but on android 2.2/2.3 range of the year is still 1900-2100. How can i change that range?
Perhaps it is because
setMaxDate
andsetMinDate
were not introduced until API 11. These xml attributes might rely on these methods. I'm speculating here, since the documentation does not list a min API level for these xml attributes. Here is a workaround tosetMaxDate
programmatically.