我使用的是西蒙的ICS日期选取器库( https://github.com/SimonVT在我的Android应用程序)。 我有一个日期按钮,如果我点击这个按钮,它会显示在对话框中的IC日期选择器。 我的问题是,如果我点击按钮,它不显示日期选择器对话框,但它显示了以下错误的:
03-02 10:46:59.521: E/AndroidRuntime(911): android.view.InflateException: Binary XML file line #20: Error inflating class net.simonvt.widget.DatePicker
03-02 10:46:59.521: E/AndroidRuntime(911): at android.view.LayoutInflater.createView(LayoutInflater.java:606)
03-02 10:46:59.521: E/AndroidRuntime(911): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
03-02 10:46:59.521: E/AndroidRuntime(911): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
03-02 10:46:59.521: E/AndroidRuntime(911): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-02 10:46:59.521: E/AndroidRuntime(911): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-02 10:46:59.521: E/AndroidRuntime(911): at net.simonvt.app.DatePickerDialog.<init>(DatePickerDialog.java:103)
03-02 10:46:59.521: E/AndroidRuntime(911): at net.simonvt.app.DatePickerDialog.<init>(DatePickerDialog.java:74)
@Override
protected Dialog onCreateDialog(int id) {
switch (id) {
case START_DATE_PICKER_ID:
mCalendar.setTimeInMillis(mStartMillis);
year = mCalendar.get(Calendar.YEAR);
monthOfYear = mCalendar.get(Calendar.MONTH);
dayOfMonth = mCalendar.get(Calendar.DAY_OF_MONTH);
return new DatePickerDialog(ListPillBoxActivity.this, startPillBoxDateListener,
year, monthOfYear, dayOfMonth);
case END_DATE_PICKER_ID:
mCalendar.setTimeInMillis(mEndMillis);
year = mCalendar.get(Calendar.YEAR);
monthOfYear = mCalendar.get(Calendar.MONTH);
dayOfMonth = mCalendar.get(Calendar.DAY_OF_MONTH);
return new DatePickerDialog(ListPillBoxActivity.this, endPillBoxDateListener, year,
monthOfYear, dayOfMonth);
}
return null;
}
对错误的两种情况下,以下行指出:
return new DatePickerDialog(ListPillBoxActivity.this, startPillBoxDateListener,
year, monthOfYear, dayOfMonth);
每一个参数是否正确传递给datePickerDialog,但有一个问题,在充气对话框
任何帮助表示赞赏....