Android Question Is it possible catching error when App is sent to Background - TransactionTooLargeException: data parcel

kiwi

Member
Licensed User
Longtime User
Hello,
I use B4XPages where received data are stored to SQLite DB and subsequenly loaded to xCustomListview which is placed to ASViewPager. ASViewPager has some pages.
I was experienced with this error in Release mode:


Error message:
2
PageChanged: 0
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 532368 bytes
    at android.app.ActivityClient.activityStopped(ActivityClient.java:88)
    at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:143)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8762)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: android.os.TransactionTooLargeException: data parcel size 532368 bytes
    at android.os.BinderProxy.transactNative(Native Method)
    at android.os.BinderProxy.transact(BinderProxy.java:662)
    at android.app.IActivityClientController$Stub$Proxy.activityStopped(IActivityClientController.java:1309)
    at android.app.ActivityClient.activityStopped(ActivityClient.java:85)
    ... 9 more
java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 532368 bytes
    at android.app.ActivityClient.activityStopped(ActivityClient.java:88)
    at android.app.servertransaction.PendingTransactionActions$StopInfo.run(PendingTransactionActions.java:143)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:226)
    at android.os.Looper.loop(Looper.java:313)
    at android.app.ActivityThread.main(ActivityThread.java:8762)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
Caused by: android.os.TransactionTooLargeException: data parcel size 532368 bytes
    at android.os.BinderProxy.transactNative(Native Method)
    at android.os.BinderProxy.transact(BinderProxy.java:662)
    at android.app.IActivityClientController$Stub$Proxy.activityStopped(IActivityClientController.java:1309)
    at android.app.ActivityClient.activityStopped(ActivityClient.java:85)
    ... 9 more
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **

I found this error by chance, because it has happend only sometimes when my app was sent to Background. It also probably happend during normal use because Android informed me that the app often crashed and I should switch it to Sleep mode. I guessed that the reason is because of debugging and testing this app.
When I found out the problem I looked for the same experience at this forum and I found this:
https://www.b4x.com/android/forum/t...-transactiontoolargeexception.149960/#content

The last post of this thread pointed me here : https://www.b4x.com/android/forum/t...expandableđź“…-payware.146808/page-2#post-950545

So I thought the problem has happened in case there are too many objects/items in ASViewPager and I wanted inform developer Alexander Stolte about this issue. But I found also this thread:
https://www.b4x.com/android/forum/threads/solved-transaction-too-large-crash.100292/

This thread is most probably my case, because when I clear data in database and now there are not too many items (before there were probably loaded more then hundred items) this error is not appear yet.
But I am not sure because of the last post of the thread above: https://www.b4x.com/android/forum/threads/solved-transaction-too-large-crash.100292/post-630859


My question is to the forum is: Can I catch exception in case the app is sent to background some way?
I have implemented catching errors in Starter module of B4XPages and it works properly. It catch Application error if happen and collect data concerning the state of app and log and it subsequently sent this data to my server.

Thanks for your opinion in advance

Jan
 
Top