The following errors are measured on Android.
Fatal Exception: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 3181388 bytes
at android.app.ActivityThread$StopInfo.run(ActivityThread.java:3950)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6501)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
If you have a large data of 1MB or more in the intent, you may get this error and crash.
It is difficult to know where the crash is from the error message.
Use ʻonSaveInstanceState to identify areas such as
.putExtra / .getExtraand
.putParcelable / .getParcelable`, and deal with areas where 1MB or more is likely to be set.
The target data is temporarily saved in a file at the timing of ʻonPause, and then recalled and expanded at the timing of ʻonResume
. If you want to save to a file, you may want to keep the path in an intent and delete it with ʻonDestroy`.
Recommended Posts