I have data that must undergo the upheavals and death of the process.
Now I have done data storage in the presenter. And in the presenter I added methods saveInstanceState(bundle state) and restoreInstanceState(Bundle state) . These presenter methods are simply called by the fragment in onSaveInstanceState and onCreate respectively.
But this is bad, because in this way the presenter knows about android sdk classes and it is not possible to test his unit with tests. Well, only if the bundle.
I was offered a solution to wrap the data in a pojo class, i.e. So that the presenter returns a pojo class that, say, Serializable and a fragment, tugged this method of the presenter, got this pojo class and already saved it in a bundle. But in this way I get a twist (fragment) is not very passive.
Maybe someone has already solved a similar problem and knows the best solution?