Android DatePickerDialog: Set min and max date for selection

前端 未结 6 800
清酒与你
清酒与你 2020-11-30 12:12

I know there are quite a lot of question for this but none of the solutions are working for me, so this question. I want to restrict user to select date before today, but am

6条回答
  •  [愿得一人]
    2020-11-30 12:55

    Above API 11 For min date you can use

    android:minDate="mm/dd/yyyy" or setMinDate(long time) For Max date

    android:maxDate="mm/dd/yyyy" // In XML

    setMaxDate(new Date().getTime());// Current time

提交回复
热议问题