AndroidDeveloperLB / MaterialPreferenceLibrary

Allows to have an ActionBar on PreferenceActivity
Apache License 2.0
406 stars 69 forks source link

BadParcelableException #28

Closed corenting closed 3 years ago

corenting commented 7 years ago

I have a rare issue occuring with the library on editing an EditText preference with some devices.

Here is the stacktrace :

Caused by: android.os.BadParcelableException:   

  at android.os.Parcel.readParcelableCreator(Parcel.java:2147)

  at android.os.Parcel.readParcelable (Parcel.java:2097)

  at android.os.Parcel.readValue (Parcel.java:2013)

  at android.os.Parcel.readSparseArrayInternal (Parcel.java:2363)

  at android.os.Parcel.readSparseArray (Parcel.java:1735)

  at android.os.Parcel.readValue (Parcel.java:2070)

  at android.os.Parcel.readArrayMapInternal (Parcel.java:2314)

  at android.os.Bundle.unparcel (Bundle.java:249)

  at android.os.Bundle.getSparseParcelableArray (Bundle.java:1273)

  at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState (PhoneWindow.java:1782)

  at android.app.Dialog.onRestoreInstanceState (Dialog.java:428)

  at com.lb.material_preferences_library.custom_preferences.DialogPreference.init (DialogPreference.java)
  or                     .getDialogMessage (DialogPreference.java)
  or                     .setDialogLayoutResource (DialogPreference.java)
  or                     .onPrepareDialogBuilder (DialogPreference.java)
  or                     .showDialog (DialogPreference.java)
  or                     .requestInputMethod (DialogPreference.java)
  or                     .onBindDialogView (DialogPreference.java)
  or                     .onDialogClosed (DialogPreference.java)

  at com.lb.material_preferences_library.custom_preferences.DialogPreference.onRestoreInstanceState (DialogPreference.java)

  at com.lb.material_preferences_library.custom_preferences.EditTextPreference.onRestoreInstanceState (EditTextPreference.java)

  at android.preference.Preference.dispatchRestoreInstanceState (Preference.java:1809)

  at android.preference.PreferenceGroup.dispatchRestoreInstanceState (PreferenceGroup.java:345)

  at android.preference.PreferenceGroup.dispatchRestoreInstanceState (PreferenceGroup.java:345)

  at android.preference.Preference.restoreHierarchyState (Preference.java:1791)

  at android.preference.PreferenceActivity.onRestoreInstanceState (PreferenceActivity.java:999)

  at android.app.Activity.performRestoreInstanceState (Activity.java:916)

  at android.app.Instrumentation.callActivityOnRestoreInstanceState (Instrumentation.java:1140)

  at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2316)

Any ideas ?

AndroidDeveloperLB commented 7 years ago

I have no idea. I don't think I saw this issue. What's the scenario?

corenting commented 7 years ago

I don't have a lot of details as this is a report from the Google Play Dev Console and I was also unable to reproduce the issue. This happened on Android 4.4 and 7.0 so far, on various phones (Samsung, LG...).

I don't know the usual scenario, except that this is coming from this settings activity : https://github.com/corenting/EDCompanion/blob/v1.2.4/app/src/main/java/fr/corenting/edcompanion/activities/SettingsActivity.java with the following preferences xml : https://github.com/corenting/EDCompanion/blob/v1.2.4/app/src/main/res/xml/settings.xml .

AndroidDeveloperLB commented 7 years ago

As I remember of how I wrote this code, it was 99% from the official Preferences code of Android. If there is an issue here, it could mean there is an issue on Android OS too. Of course, it can also mean that what I did was incorrect. Maybe it's time to check the code again, vs what I wrote.