我需要开发一个应用程序,要求用户在日历
中选择多个日期Override
protected Dialog onCreateDialog(int id) {
// TODO Auto-generated method stub
Calendar cal = Calendar.getInstance();
DatePickerDialog datePicker = new DatePickerDialog(DatePicker.this,new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
EditText edt_Bdate=(EditText)findViewById(id);
edt_Bdate.setText(year+"-"+(monthOfYear+1)+"-"+dayOfMonth);
}
},cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),
cal.get(Calendar.DAY_OF_MONTH));
return datePicker;
}
}
但不推荐使用此代码