Now as shown in the screen shot earlier, we have to choose the min and max dates and then press the “Select Date” button. It will open the custom date picker dialog. The DatePicker will not allow us to set the dates which are outside of the min and max date range.

Above code has been checked in devices having,

Android OS version 2.2

Android OS version 2.3.x

For devices having Android OS version 3.0 and above, the DatePicker gives the methods setMinDate() and setMaxDate() to set the min and max dates respectively.

I hope this has helped you to understand how to implement a custom date picker control with maximum and minimum date ranges in Android application development. We would love to hear your feedbacks and suggestions, kindly drop it in comments. Thanks !