Transactiontoolargeexception Even When File Size Is Super Small
Solution 1:
So what it ultimately took resolve this TransactionTooLarge Exception, was to identify the Activity that had its subordinate fragments, views etc adding data parcels to the bundle. Then I ran this code in said Activity:
@OverrideprotectedvoidonSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
//Clear the Activity's bundle of the subsidiary fragments' bundles.
outState.clear();
}
That fixed it for me. Hope this help someone out there!
Solution 2:
Okay, so this answer is quite late, but will surely help someone who is finding a possible solution for TransactionTooLargeException while passing the date between two Activity.
I have already written an answer on how to pass large data from one Activity to Another and the solution uses Shared Preference to store the Bundle and pass it to the other Activity. Here is the answer How to pass large data between two activities
Note: This solution clears the stored Bundle after being read and will not return the Bundle if the Activity is recreated. This is a workaround and any suggestion or issues will be highly appreciated.
Post a Comment for "Transactiontoolargeexception Even When File Size Is Super Small"