I am using higher then API 11, here some problem during hide future date:
@Override
protected Dialog onCreateDialog(int id) {
Calendar c = Calendar.getInstance();
int cyear = c.get(Calendar.YEAR);
int cmonth = c.get(Calendar.MONTH);
int cday = c.get(Calendar.DAY_OF_MONTH);
switch (id) {
case DATE_DIALOG_ID:
DatePickerDialog dialog = new DatePickerDialog(this, mDateSetListener, cyear, cmonth, cday);
dialog.getDatePicker().setMaxDate(new Date());
return dialog;
/*return new DatePickerDialog(this, mDateSetListener, cyear, cmonth,
cday);*/
}
return null;
}
I have problem: setMaxDate(new Date());
I get this error:
The method setMaxDate(long) in the type DatePicker is not applicable for the arguments (Date)
So, Please how to hide future date .