使用putExtra()

时间:2015-07-12 19:58:44

标签: android marker

我点击标记,我正在尝试打开新活动。当我没有putExtra意图中的信息时,我可以打开活动,但是当我尝试向第二个活动发送10个字符串时,它会向我显示:

07-12 19:40:04.508: W/ActivityManager(1251): Exception in new application when starting activity com.wunderlist.slidinglayersample/.Builder
07-12 19:40:04.508: W/ActivityManager(1251): android.os.TransactionTooLargeException
07-12 19:40:04.508: W/ActivityManager(1251):    at android.os.BinderProxy.transactNative(Native Method)
07-12 19:40:04.508: W/ActivityManager(1251):    at android.os.BinderProxy.transact(Binder.java:496)
07-12 19:40:04.508: W/ActivityManager(1251):    at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:793)
07-12 19:40:04.508: W/ActivityManager(1251):    at com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:1157)
07-12 19:40:04.508: W/ActivityManager(1251):    at com.android.server.am.ActivityStackSupervisor.attachApplicationLocked(ActivityStackSupervisor.java:526)
07-12 19:40:04.508: W/ActivityManager(1251):    at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:6192)
07-12 19:40:04.508: W/ActivityManager(1251):    at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:6254)
07-12 19:40:04.508: W/ActivityManager(1251):    at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:481)
07-12 19:40:04.508: W/ActivityManager(1251):    at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2407)
07-12 19:40:04.508: W/ActivityManager(1251):    at android.os.Binder.execTransact(Binder.java:446)
07-12 19:40:04.508: A/ActivityManager(1251): Exception thrown launching activities in ProcessRecord{b21e6f4 4200:com.wunderlist.slidinglayersample/u0a57}
07-12 19:40:04.508: A/ActivityManager(1251): android.os.TransactionTooLargeException
07-12 19:40:04.508: A/ActivityManager(1251):    at android.os.BinderProxy.transactNative(Native Method)
07-12 19:40:04.508: A/ActivityManager(1251):    at android.os.BinderProxy.transact(Binder.java:496)
07-12 19:40:04.508: A/ActivityManager(1251):    at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:793)
07-12 19:40:04.508: A/ActivityManager(1251):    at com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:1157)
07-12 19:40:04.508: A/ActivityManager(1251):    at com.android.server.am.ActivityStackSupervisor.attachApplicationLocked(ActivityStackSupervisor.java:526)
07-12 19:40:04.508: A/ActivityManager(1251):    at com.android.server.am.ActivityManagerService.attachApplicationLocked(ActivityManagerService.java:6192)
07-12 19:40:04.508: A/ActivityManager(1251):    at com.android.server.am.ActivityManagerService.attachApplication(ActivityManagerService.java:6254)
07-12 19:40:04.508: A/ActivityManager(1251):    at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:481)
07-12 19:40:04.508: A/ActivityManager(1251):    at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2407)
07-12 19:40:04.508: A/ActivityManager(1251):    at android.os.Binder.execTransact(Binder.java:446)

我甚至不知道从哪里开始阅读这个因为我不知道发生了什么。我的生活中没有出现这个错误。可能是超时之类的东西,我不能将额外的信息放在意图中,或者是其他的东西。因为我试图在一个字符串中发送大量信息而且它有效。但是,当我提出这么多额外信息时,它就会崩溃。

2 个答案:

答案 0 :(得分:2)

您正在发送大量数据。尝试作为数组或Bundle发送 检查这个答案:BUNDLE DATA

答案 1 :(得分:0)

正如异常所说,您要发送捆绑包中的大数据。尝试将其作为对象发送并使用putSerialisable