<@UHAJKUSTU> What is the best approach to avoid co...
# decompose
e
@Arkadii Ivanov What is the best approach to avoid configuration serialization of a particular configuration containing a big byte array, which doesn’t fit into Bundle?
a
You can try wrapping the configuration into another class with a
@Transient
property containing the actual configuration. Though, the data will be lost and I'm not sure how you will restore the component. Or do you want to remove the configuration from the navigation on saving?
e
yes, because it doesn’t make any sense to save the configurations, it’s better to remove it in this case
a
Oh, in this case you can try supplying the saveState and restoreState arguments and save the configurations manually.
e
should I use this method and pass custom
saveStack
and
restoreStack
?
a
Yep, this should be the way.
e
thank you!
👍 1
@Arkadii Ivanov the list in this
saveStack
contains all configuration including the top one, right? To get this top one should I just take the last one from the list? And can I just pass changed list without this last element in my case to the
fun <T : Any> SerializableContainer
?
a
Yes, correct. The order is from bottom to top. The last item is the currently active component. Yes just passing the changed list to SerializableContainer. And then restore it the same way.
e
thanks, again! :)
👍 1