I have a custom linear layout which has DatePicker and TimePicker widgets in it. This is used as DateTime picker. I want to restrict the DatePicker by way of setMaxDate() and setMinDate(). I have done:
dp.setMaxDate(new DateTime().minusDays(1).getMillis());
dp.setMinDate(new DateTime().minusDays(30).getMillis());
The dates beyond this range are actually grayed out when the dialog appears. But I can still select a grayed date. I have stumbled upon this. But, what is the work around for a custom layout with datepicker in it?

