sockeqwe / mosby-conductor

Plugin for conductor to integrate Mosby
Apache License 2.0
131 stars 22 forks source link

Unable to store router's backstack. #31

Closed uburoiubu closed 6 years ago

uburoiubu commented 6 years ago

I have an Activity inside which a Controller (CardController) inside which I have a ViewPager with Controllers as Pages which in their turn could be opened (i.e. pushed) - again - as Controller. How would I save ViewPager state and overall stack of controllers which get pushed on CardController using your ViewState concept? I get how I can save data for adapter, but I don't get how I store controller stack resulting from user's choice which controller to open?

So here's an example flow:

Activity - CardController created -> user chooses a Tab > user chooses an item inside a tab > Controller gets opened. The device is rotated. Everything is recreated.

sevar83 commented 6 years ago

Did you try with RETAIN_DETACH for the controller with the ViewPager. And do you use RouterPagerAdapter as adapter for the ViewPager?

uburoiubu commented 6 years ago

@sevar83, thanks for response. I did both. Here I elaborate more on that:

https://stackoverflow.com/questions/47232228/conductors-controller-unexpected-lifecycle

sockeqwe commented 6 years ago

Hm, I'm sorry but I think this is not Mosby related. Mosby doesnt do any magic or changes or manipulates Lifecycle of a controller somehow. Mosby is just using the regular lifecycle events your controller get to save and restore the ViewState. You also don't have to store controller stack, thats all Conductors responsibility and has nothing to do with Mosby. You better post your question / link to stackoverflow in Conductors repository here on github.

Btw. I don't know why onDestroyView () is called as described in your stackoverflow question ...

Evgenii Kozlov notifications@github.com schrieb am Sa., 11. Nov. 2017, 20:52:

@sevar83 https://github.com/sevar83, thanks for response. I did both. Here I elaborate more on that:

https://stackoverflow.com/questions/47232228/conductors-controller-unexpected-lifecycle

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sockeqwe/mosby-conductor/issues/31#issuecomment-343689871, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjnrj_D9YvfF9xFdmv8rq-kpRCYql0dks5s1fsIgaJpZM4QZ8oJ .

uburoiubu commented 6 years ago

Thanks for your answer anyway.