活动开始并更新UI后的Android TransactionTooLargeException

时间:2017-06-26 02:38:41

标签: android sqlite

我对这个特殊问题感到困惑,可以真正使用一些帮助。

我的应用程序的电影详细信息屏幕通过意图从MainActivity接收两个整数。其中一个整数是用于查询存储在用户设备上的SQLite数据库的唯一ID,以获取用户选择的电影的完整详细信息。

当数据库达到35-40部电影时,将发生TransactionTooLargeException错误并使我的应用程序崩溃。经过一些彻底的测试后,我无法找到发生此错误的原因。

我所知道的:在查询数据库之后以及使用数据库查询中的详细信息更新UI之后发生错误(请参阅下面的错误堆栈)。

任何人都可以帮我弄清楚这个错误发生的原因吗?

06-25 22:12:21.099 29350-29350/jkaps9.movieapp E/LC: Main onCreate
06-25 22:12:22.315 29350-29350/jkaps9.movieapp E/MovieFragment: Num movies: 40
06-25 22:12:31.891 29350-29350/jkaps9.movieapp E/LC: MovieAdapter - sending intent to detail
06-25 22:12:31.930 29350-29350/jkaps9.movieapp E/LC: Main onPause
06-25 22:12:32.053 29350-29350/jkaps9.movieapp E/LC: Detail onCreate
06-25 22:12:32.222 29350-29350/jkaps9.movieapp E/LC: Detail onResume
06-25 22:12:32.314 29350-29350/jkaps9.movieapp E/DB: querying DB for movie details
06-25 22:12:32.378 29350-29350/jkaps9.movieapp E/Detail: Getting movie from DB
06-25 22:12:32.378 29350-29350/jkaps9.movieapp E/Detail: Updating UI with movie details
06-25 22:12:32.383 29350-29350/jkaps9.movieapp E/Detail: Finished updating UI with movie details
06-25 22:12:32.415 29350-29350/jkaps9.movieapp E/ViewRootImpl: sendUserActionEvent() mView == null
06-25 22:12:32.505 29350-29350/jkaps9.movieapp E/ViewRootImpl: sendUserActionEvent() mView == null
06-25 22:12:33.200 29350-29350/jkaps9.movieapp E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 532192)
06-25 22:12:33.201 29350-29350/jkaps9.movieapp E/AndroidRuntime: FATAL EXCEPTION: main

Process: jkaps9.movieapp, PID: 29350
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 532192 bytes
    at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4211)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6688)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
 Caused by: android.os.TransactionTooLargeException: data parcel size 532192 bytes
    at android.os.BinderProxy.transactNative(Native Method)
    at android.os.BinderProxy.transact(Binder.java:628)
    at android.app.ActivityManagerProxy.activityStopped(ActivityManagerNative.java:4132)
    at android.app.ActivityThread$StopInfo.run(ActivityThread.java:4203)
    at android.os.Handler.handleCallback(Handler.java:751) 
    at android.os.Handler.dispatchMessage(Handler.java:95) 
    at android.os.Looper.loop(Looper.java:154) 
    at android.app.ActivityThread.main(ActivityThread.java:6688) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) 

0 个答案:

没有答案