I'm trying to fix TransactionTooLarge
exceptions. I can't find any main culprits in onSaveInstanceState
.
However, when it comes to passing things to intents and bundles, I am seeing a lot of the follow type of code on a fragment.
companion object {
fun newInstance(item1: Item1, item2: Item2): MyFragment {
val fragment = MyFragment()
val args = Bundle()
args.putParcelableArrayList(ITEM_1_KEY, item1)
args.putInt(ITEM_2_KEY, item2)
fragment.arguments = args
return fragment
}
}
Essentially there's a bunch of code passing data models everywhere.
How do you get around trying to pass smaller objects in bundles to fragments?
These fragments basically just pick these up and use them. It feels difficult to avoid passing these through.