Closed frank-fan closed 8 years ago
Thats coz the traversal hasn't completed for the new screen and screen orientation causes the activity to be recreated, which makes the old history be restored. You can try to make the newer history be stored and let the orientation dictate the dispatching:
onTraversalCompleted
callback in your dispatcher to invoke any necessary orientation changes after the traversal completes, i.e. queue it uponTraversalCompleted
) if there is a orientation change required and let the orientation change construct the screen with the new history.
Hi, I manage all my app screens in one activity using mortar & flow. But I got a problem when I have a different orientation screen:
I try to invoke this to change orientation in ViewPresenter.onLoad();
The orientation is changed, but it's the previous screen. I think when ViewPresenter.onLoad, the screen-view is not fully attached.Too soon to request orientation changes, may interrupt the attach-process.
So I add a delay with handler,
It worked, the orientation changed, and the screen is right. But a delay make the experiences miserable.
I'm new to Mortar & path, please help me to solve this problem, thanks!