我有一个日期选择器我想设置一个最小日期,这样当用户设置一个日期时它不应该允许低于那个最小日期并且那个日期应该不小于明天
我做过
//==============Date Picker============================
@Override
protected Dialog onCreateDialog(int id) {
switch(id){
case ID_DATEPICKER:
return new DatePickerDialog(this,myDateSetListener,myYear, myMonth, myDay);
default:
return null;
}
}
private DatePickerDialog.OnDateSetListener myDateSetListener = new DatePickerDialog.OnDateSetListener()
{
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth)
{
String date = String.valueOf(dayOfMonth)+"/"+ String.valueOf(monthOfYear+1) +"/"+ String.valueOf(year);
dateEditText.setText(date);
}
};
//==============Date Picker============================