Reputation: 1977
I 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.
Upvotes: 4
Views: 612
Reputation: 1364
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.
Upvotes: 1