我在尝试在单击按钮时创建事件对话框时遇到问题,但是没有对话框可以从中选择日期 这是我的代码
我正在调用 buttonCLick showDialog(2);
protected Dialog onCreateDialog(int id)
{
switch (id)
{
case 2:return showDatePicker();
}
return dialog;
}
private DatePickerDialog showDatePicker()
{
DatePickerDialog datePicker= new DatePickerDialog(dodadi.this, new DatePickerDialog.OnDateSetListener() {
//@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,int dayOfMonth)
{
mCalendar.set(Calendar.YEAR,year);
mCalendar.set(Calendar.MONTH,monthOfYear);
mCalendar.set(Calendar.DAY_OF_MONTH,dayOfMonth);
updateDateButtonText();
//super.onDateSet(view,year,monthOfYear,dayOfMonth);
}
}, mCalendar.get(Calendar.YEAR),mCalendar.get(Calendar.MONTH),mCalendar.get(Calendar.DAY_OF_MONTH));
return datePicker;
}