Closed uburoiubu closed 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
?
@sevar83, thanks for response. I did both. Here I elaborate more on that:
https://stackoverflow.com/questions/47232228/conductors-controller-unexpected-lifecycle
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 .
Thanks for your answer anyway.
I have an
Activity
inside which a Controller(CardController)
inside which I have aViewPager
withControllers
as Pages which in their turn could be opened (i.e. pushed) - again - asController
. How would I save ViewPager state and overall stack of controllers which get pushed onCardController
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.