konmik / nucleus

Nucleus is an Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.
MIT License
1.98k stars 253 forks source link

Presenter persistence (questions, not an issue) #128

Closed mylesbennett closed 6 years ago

mylesbennett commented 7 years ago

I wanted to use the same principle as you have used for persisting Presenter objects to persist other objects. There is a couple of things in your code that I don't understand which I hoped you could explain.

Thanks for the great library!

rgds, Myles

konmik commented 7 years ago

Hi, it checks for null because there is no guarantee that it is not null. For example there is View lifecycle, sometimes you get onRestore after onAttachedToWindow

konmik commented 7 years ago

the bundle is being marshalled and back because there can be some mutable data in it and when you alter it after it was put into the bundle it can lead to really hard to debug issues on restoration.