Setting MinDate on DatePicker moves CalendarView to 1964

后端 未结 5 1711
离开以前
离开以前 2020-12-08 16:40

I\'m debugging an issue where the CalendarView in a DatePicker moves to October 1964 if there is a non-default minimum date set. This reproduces at

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-08 17:09

    The solution that I ended up using:

    private void fixBuggyCalendarview(CalendarView cv) {
        long current = cv.getDate();
        cv.setDate(cv.getMaxDate(), false, true);
        cv.setDate(current, false, true);
    }
    

    This also works when you have set min/max date for the CalendarView

提交回复
热议问题