livefront / bridge

An Android library for avoiding TransactionTooLargeException during state saving and restoration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TransactionTooLargeException in Activity with TabHost

rootsavaris opened this issue · comments

Hello, i am using the bridge library with Icepick. it´s seem me that is working fine in 95 % of my application.
But, i have a activity that use one TabHost. For each tab of my component i create a instance of fragment and then i atach or detach depending on visibility of the tab.
Usually, i have 5 fragments created at same time.
Sometimes, the exception occurs.
i am using the bridge in my activity on methods OnCreate and onSaveInstanceState.
Do you have some ideia for this case ? Does the bridge work inside fragments ?

Yes, Bridge is meant to work with Fragments. I might need to see more details of your setup to know what specifically might be your problem. Note that the Fragments themselves also need to call Bridge.saveInstanceState / Bridge.restoreInstanceState; its not just something you call for the Activity. I'm not sure if that's your issue, though.

Hum, i will use the calls inside fragments so.. i imagine that can be this my problem.
i think interesting have a project samples in this git to help when and how use in especific cases.
For example, when call and not call Bridge.clear or Bridge with FragmentAdapters. It is easiar for understanding.
Thanks for help

Yeah I completely agree with you : this project needs both a sample app and some unit tests. They're on my roadmap, but I just haven't had time to get around to them yet unfortunately.

Please let me know if you still have problems once you add the Bridge calls to the Fragments as well.

@rootsavaris I'm going to close this issue now. If you have any more concerns, feel free to reopen it.