Android ViewPager2 library throwing Transactiontoolarge exception onpause event

Viewed 247
1 Answers

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.

Related