Set android datepicker date limits
问题 I am using datePicker in android to display images based on user selected dates. I need to limit said dates to certain days for instance Jan 1st 2010 to Dec 31st 2010. Simple as that i thought but no where can i find the answer on how to limit these dates. Does anyone know how to limit the dates for Android DatePicker 回答1: You can just set : dateDialog.getDatePicker().setMaxDate(new Date().getTime()); and dateDialog.getDatePicker().setMinDate(new Date().getTime()); where dateDialog is a new