ClassNotFoundException when unmarshalling: android.support.v4.view.ViewPager$SavedState

后端 未结 5 771
孤街浪徒
孤街浪徒 2020-12-10 10:09

I am seeing the following error in my Android crash reports:

android.os.BadParcelableException: ClassNotFoundException when unmarshalling: android.support.v4         


        
5条回答
  •  执笔经年
    2020-12-10 11:01

    I had the same error and here is what I did.

    My issue came from using the ViewPager with a FragmentStatePagerAdapter. Inside one of the Fragments from the ViewPager had another ViewPager. Having that second view pager caused this rare bug. Even with or without an adapter on it.

    The solution was to simply set setSaveEnabled(false); on the second ViewPager.

提交回复
热议问题