I am trying to set the min and max date of the date picker in Android to before API level 11. I used the following code:
mDatePickerField = startDatePickerDi
Just Use Value(Min & Max) Comes From Calender to set DatePiker.MaxDate & DatePiker.MinDate try some thing like :
DatePickerDialog dialog = new DatePickerDialog();
Java.Util.TimeZone GMT = new SimpleTimeZone(TimeZoneInfo.Local.BaseUtcOffset.Hours, "GMT");
Calendar maxDate = Calendar.GetInstance(GMT);
maxDate.Set(DateTime.Now.Year, DateTime.Now.Month - 1, DateTime.Now.Day);
Calendar minDate = Calendar.GetInstance(GMT);
minDate.Set(DateTime.Now.Year - 2, DateTime.Now.Month - 1, DateTime.Now.Day);
dialog.DatePicker.MaxDate = maxDate.TimeInMillis;
dialog.DatePicker.MinDate = minDate.TimeInMillis;