How to disable certain dates in the Android Date Picker dialog?

Alex Wih picture Alex Wih · Jan 11, 2016 · Viewed 8.4k times · Source

I am using default Android DatePickerDialog which contains android.widget.DatePicker.

Does anybody know how to disable or make certain dates unselectable?

I know DatePicker allows to setMinDate() and setMaxDate() but it doesn't allow to disable specific dates in the middle.

e.g. on this picture would like to disable date 18, 26, etc:

enter image description here

Answer

ianhanniballake picture ianhanniballake · Jan 11, 2016

That is not a built in behavior - you would have to use a custom date picker.