当用户选择带有“DatePickerDailog”的日期时,我收到此错误。
我在应用程序日志中播下了这个错误。
该应用程序可能在Android 4.4.4版本上运行。
代码:
DatePickerDialog.OnDateSetListener datePickerListener = new DatePickerDialog.OnDateSetListener() {
@Override
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
monthOfYear++;
birthDate = year + "-" + monthOfYear + "-" + dayOfMonth + "T" + "00:00:00Z";
tvBirthDate.setText(dayOfMonth + "/" + monthOfYear + "/" + year);
}
};
日志:
java.lang.NoSuchMethodError: android.widget.DatePicker.callOnValueChange
1 at android.widget.DatePicker$OnDateChangeListener.onValueChange(DatePicker.java:162)
2 at android.widget.NumberPicker.notifyChange(NumberPicker.java)
3 at android.widget.NumberPicker.setValueInternal(NumberPicker.java)
4 at android.widget.NumberPicker.scrollBy(NumberPicker.java)
5 at android.widget.NumberPicker.onTouchEvent(NumberPicker.java)
6 at android.view.View.dispatchTouchEvent(View.java)
7 at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java)
8 at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java)
9 at android.widget.NumberPicker.dispatchTouchEvent(NumberPicker.java)