简体   繁体   中英

Android. Why E/JavaBinder: FAILED BINDER TRANSACTION?

I have read a lot of posts about this error, most of them regarding managing an image.

But I'm getting this error when I stop the app (put in background), so should be regarding data in memory...

I'm not doing anything in onStop() of my fragment and activity.

I have checked onSaveInstanceState(final Bundle outState) and the bundle is empty... ¿?

I have 5 ArrayList of objects and making tests I realized that if I don't have the biggest one the error is not thrown.

My app is going to has more data than now it has, so it is a problem.

Could anyone explain me about why I'm getting this and how I have to handle this??

Error:

01-25 13:51:09.272 4940-4940/com.cathedralsw.schoolteacher E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 539984)

 --------- beginning of crash 01-25 13:51:09.281 4940-4940/com.cathedralsw.schoolteacher E/AndroidRuntime: FATAL

EXCEPTION: main Process: com.cathedralsw.schoolteacher, PID: 4940 java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 539984 bytes at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4039) at android.os.Handler.handleCallback(Handler.java:761) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:156) at android.app.ActivityThread.main(ActivityThread.java:6595) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) Caused by: android.os.TransactionTooLargeException: data parcel size 539984 bytes at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(Binder.java:617) at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:3632) at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4031) at android. os.Handler.handleCallback(Handler.java:761) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:156) at android.app.ActivityThread.main(ActivityThread.java:6595) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832) 01-25 13:51:09.286 1795-5775/? E/ReportTools: This is not beta user build

You are moving too much data through a binder interface. This can happen if using a custom binder interface and passing large object, or if you are attaching extras to an Intent which a very large (or lots of objects so the size adds up.) This could be when sending an Intent or when receiving a result. Binder is used for any kind of cross process communication in Android and still is used when starting activities in the same app. Binder has a limited sized buffer internally, so large transactions can cause failures like this.

Rather than place your data into the Intent directly, or pass it directly to a binder based method call, pass a reference of some kind and the receiver can access the dates using the reference. For example, send an id for the data stored in a DB or similar mechanism.

在我的情况下,问题是一个使堆栈饱和的方法(递归)的无限循环。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM