4

enter image description hereI am getting TransactionTooLarge exception if page size = 50 and I press the home button. I checked the FragmentStateAdapter and found that 'saveState()' method is finalized. Please help me how to resolve this.

In ViewPager it was overriden by me using below link- https://medium.com/@mdmasudparvez/android-os-transactiontoolargeexception-on-nougat-solved-3b6e30597345

But no way in View pager2 library.

Ashish Agrawal
  • 1,977
  • 2
  • 18
  • 32

1 Answers1

1

I had terrible random crash with my fragments. The one megabyte limit is system wide, so it can crash at much lower thresholds.

I fixed the issue by stopping to use serialized objects and only passing integers into intents and fragment arguments.

Then fragments and activities can get the actual object from a repository using the integer id I gave to it. It is faster and with insight it is a lot simpler.

Pascal Ganaye
  • 1,174
  • 12
  • 28