由于android.os.TransactionTooLargeException引起:数据包大小为5971992字节,是否有工具可以调试此错误?

5

我正在处理生产应用,Crashlytics提示了异常。但是它没有指明发生的位置,我不知道出了什么问题。错误信息如下:

Caused by android.os.TransactionTooLargeException: data parcel size 5971992 bytes
   at android.os.BinderProxy.transactNative(BinderProxy.java)
   at android.os.BinderProxy.transact(BinderProxy.java:1179)
   at android.app.IActivityManager$Stub$Proxy.activityStopped(IActivityManager.java:3969)
   at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:144)
   at android.os.Handler.handleCallback(Handler.java:873)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loop(Looper.java:193)
   at android.app.ActivityThread.main(ActivityThread.java:6898)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

有没有工具或库可以检测此问题?

我也查看了这个链接 What to do on TransactionTooLargeException

我尝试使用了这个工具 https://github.com/guardian/toolargetoo,但对我没有帮助。能否请您分享一下您的想法。


1
你是不是通过Intent将大量数据传递给另一个Activity?可以检查一下吗?没有更多细节很难说清楚发生了什么。 - undefined
你需要自己调试。这里提供的细节不足以让任何人推测发生了什么。 - undefined
1
除了Intents之外,还要查看您的活动和片段,看看它们是否会在实例状态包中存储大量数据。 - undefined
非常感谢大家,我会尽力调试所有的地方。 - undefined
@CommonsWare 谢谢,伙计。我从你的评论中得到了答案。这是因为将可序列化的位图放入保存的实例状态 Bundle 中。 - undefined
显示剩余3条评论
1个回答

0
由于android.os.TransactionTooLargeException引起:数据包大小为5971992字节,是否有工具可以调试此错误
将数据存储到SharedPreferences中,像这样
SharedPreferences.Editor editor = sharedpreferences.edit();
                            editor.putString("HipId",services.get(position).getId());
                            editor.putString("PatientId",services.get(position).getPatient_id());
                         editor.putString("DataPush",services.get(position).getData_push());
editor.apply();// this Kb Data
Intent intent = new Intent(context, SecondActivity.class);
startActivity(intent);

and fetch the Data SecondActivity class

     hipId=sharedpreferences.getString("HipId", "");;
      PatientId=sharedpreferences.getString("PatientId", "");
     String data=sharedpreferences.getString("DataPush", "");

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接