App crashes with TransactionTooLargeException when onRestoreInstanceState called
See original GitHub issueProblem
After putting large bitmap to the Parcelable TransactionTooLargeException
will be thrown.
You are putting bitmap in onRestoreInstanceState
method:
bitmap = (Bitmap)bundle.getParcelable("SET_BITMAP");
Google doc about TransactionTooLargeException
:
The Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. Consequently this exception can be thrown when there are many transactions in progress even when most of the individual transactions are of moderate size.
Steps to reproduce
- Turn on “Don’t keep activities” option in developer options
- Open Editor Activity with large photo
- Press home button to minimize application
- Open it from recents
TransactionTooLargeException
will be thrown
Possible solution:
- Never put bitmap to the Parcelable and load it again when the view restores.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
What to do on TransactionTooLargeException - Stack Overflow
I encountered this issue, and I found that when there huge amount of data getting exchanged between a service and an application,(This involves...
Read more >TransactionTooLargeException on pausing app [37103380]
Trying to override the onSaveInstanceState in the fragment, and do nothing for OS N, doesn't get called before the crash.
Read more >Demystify TransactionTooLargeException | by Rex Huang
Recently, ShopBack Android app had encountered a stability issue caused by TransactionTooLargeException which led app crash-free rate drop significantly.
Read more >Avoiding TransactionTooLargeException on Android Nougat ...
Anything over that limit is causing your app to crash with the ... system instead of providing it to the operation system, called...
Read more >Instrumentation | Android Developers
Perform calling of an activity's Activity#onRestoreInstanceState method. ... for later versions, it will return null if UiAutomation fails to connect.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ArthurHub Thanks. Verified the fix.
fixed in 2.4.3