0
我有一個問題,試圖在點擊按鈕創建事件的對話,但沒有從那裏我可以在這裏選擇日期對話框是我的代碼android,當我嘗試調用datepickerdialog它不顯示?
我對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;
}