iFixit / iFixitAndroid

Official iFixit Android App
https://play.google.com/store/apps/details?id=com.dozuki.ifixit
GNU General Public License v3.0
162 stars 88 forks source link

Guide view: Fix restore fragment state crash #212

Closed marczych closed 10 years ago

marczych commented 10 years ago

We've had several puzzling crash reports for a while: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v4.app.FragmentManagerState

I finally reproduced it:

  1. Enable Settings -> Developer options -> Don't keep activities.
  2. Open guide view.
  3. Click on a part or tool.
  4. Hit back.
  5. Swipe to other steps and back.
  6. Go to 3.

In my experience it takes 2 tries to get it to crash. Turns out it's a bug in the support library: https://code.google.com/p/android/issues/detail?id=37484#c1

The upside is that it's an easy fix. The downside is that we have to extend the class at android.v4.app.FixedFragmentStatePagerAdapter and use that one in place of the default implementation.