setMinDate(…) for DatePicker doesn't work when invoked a second time

后端 未结 4 1154
终归单人心
终归单人心 2021-01-07 23:41

I\'m in a particular situation in which I have to alter the min and max date of DatePicker according to the selected element of a Spinner. Here\'s

4条回答
  •  忘掉有多难
    2021-01-07 23:57

    As said above, you can bypass the check by calling those before actually changing the value:

    setMinDate(0);
    setMaxDate(Long.MAX_VALUE);
    

    If you want to reset the minimum or maximum value to its default, you can use the following values:

    setMinDate(-2208902400000L);  // Jan 1, 1900
    setMaxDate(4102531200000L);  // Jan 1, 2100
    

提交回复
热议问题