I sometimes get TransactionTooLargeException
in onSaveInstanceState
. So, I'm assuming that the size of my Bundle
being too large is causing this. I'd like to log its exact/approx size so I can get a rough estimate of the amount I need to minimize it by.
Right now, the only way I can find its size is when the TransactionTooLargeException
is thrown with
E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 1026104)
D/AndroidRuntime: Shutting down VM
I/art: Compiler allocated 6MB to compile void com.example.ExampleModel.writeToParcel(android.os.Parcel, int)
E/UncaughtException: java.lang.RuntimeException: android.os.TransactionTooLargeException: data parcel size 1026104 bytes