首先,这里是代码:
private DatePickerDialog.OnDateSetListener pDateSetListener = new DatePickerDialog.OnDateSetListener() {
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
pYear = year;
pMonth = monthOfYear;
pDay = dayOfMonth;
updateDisplay();
}
};
/** Updates the date in the TextView */
private void updateDisplay() {
String pMonthName;
pMonthName = cal.getDisplayName(pMonth + 1, Calendar.LONG, Locale.US);
pPickDate.setText(pMonthName + " " + pDay + ", " + pYear);
}
当我将日期选择输出到 时TextView
,我得到:
null, 26, 2013
有人可以看到我哪里出错了吗?我知道它在getDisplayName()
排队(我认为)。