2

If i use DatePicker i can set the min and max year.

<DatePicker android:startYear="1900"
              android:endYear="3000"
...

How can i set the endYear for the DatePickerDialog?

My attempt with a style did NOT work:

<resources>
    <style name="datePickerStyle" arent="@android:style/Theme_Dialog_Alert">
        <item name="android:endYear">3000</item>
        <item name="android:startYear">1000</item>
   </style>
</resources>

new DatePickerDialog(this, R.style.datePickerStyle, ...

The DatePickerDialog getDatePicker() method does not exist in app versions < 11.

Is there any way to do this?

Dirk Jäckel
  • 2,979
  • 3
  • 29
  • 47
tütü
  • 1,481
  • 1
  • 10
  • 6

0 Answers0