Ausnahme: android.view.InflateException: Binäre XML-Datei Zeile 20: Fehler beim Aufblasen der Klasse net.simonvt.datepicker.DatePicker
Ich arbeite an einer Android-Anwendung, die ich verwendesimonvt
Datepicker-Bibliothek wegen Abwärtskompatibilität, aber ich sehe in meinem Absturzbericht der Entwicklerkonsole 3 Berichte für denselben Fehler, aber das habe ich auf meinem Gerät versucht, das funktioniert, also ist das wirklich komisch.
Bitte stützen Sie sich dafür, warum es so seltsam ist und irgendwann Ausnahmen gibt.
OnDateSetListener date = new OnDateSetListener() {
private void updateLabel() {
String myFormat = "EEE, dd MMM"; // In which you need put here
String myDbFormat = "dd/MM/yyyy";
SimpleDateFormat sdf = new SimpleDateFormat(myFormat, Locale.US);
SimpleDateFormat DBsdf = new SimpleDateFormat(myDbFormat, Locale.US);
Departure_date = sdf.format(myCalendar.getTime());
Departure_date_url = DBsdf.format(myCalendar.getTime());
Log.i("Departure_date", Departure_date);
date_btn.setText(sdf.format(myCalendar.getTime()));
}
@Override
public void onDateSet(net.simonvt.datepicker.DatePicker view, int year,
int monthOfYear, int dayOfMonth) {
myCalendar.set(Calendar.YEAR, year);
myCalendar.set(Calendar.MONTH, monthOfYear);
myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
updateLabel();
}
};
Zeilennr .: 703
final net.simonvt.datepicker.DatePickerDialog dpd = new net.simonvt.datepicker.DatePickerDialog(
getActivity(), date, myCalendar.get(Calendar.YEAR),
myCalendar.get(Calendar.MONTH), myCalendar
.get(Calendar.DAY_OF_MONTH));
Logcat:
android.view.InflateException: Binary XML file line #20: Error inflating class net.simonvt.datepicker.DatePicker
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.inflate(LayoutInflater.java:469)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at net.simonvt.datepicker.DatePickerDialog.<init>(DatePickerDialog.java:106)
at net.simonvt.datepicker.DatePickerDialog.<init>(DatePickerDialog.java:77)
at in.mypackage$15.onClick(RailTicket_Book.java:703)
at android.widget.AutoCompleteTextView$PassThroughClickListener.onClick(AutoCompleteTextView.java:1260)
at android.view.View.performClick(View.java:4471)
at android.view.View$PerformClick.run(View.java:18797)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5299)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
... 19 more
Caused by: java.lang.IllegalArgumentException: Bad pattern character 'E' in EE,dd MMM yyyy
at libcore.icu.ICU.getDateFormatOrder(ICU.java:165)
at android.text.format.DateFormat.getDateFormatOrder(DateFormat.java:388)
at net.simonvt.datepicker.DatePicker.reorderSpinners(DatePicker.java:515)
at net.simonvt.datepicker.DatePicker.<init>(DatePicker.java:284)
at net.simonvt.datepicker.DatePicker.<init>(DatePicker.java:149)
... 22 more
Danke im Voraus