Last active
October 16, 2017 17:21
-
-
Save szeidner/20a012af02142a9abdacf5b6a3a31a6d to your computer and use it in GitHub Desktop.
Flow w/Flow-Navigation and replacing the stack without retaining presenters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get size of the history | |
int historySize = Flow.get(context).getHistory().size(); | |
// pop all old history off the stack | |
History.Builder builder = history.buildUpon(); | |
while (historySize > 1) { | |
builder.pop(); | |
Flow.get(context).setHistory(builder.build(), Flow.Direction.REPLACE); | |
historySize--; | |
} | |
// set the real destination | |
Flow.get(context).setHistory(History.single(path), Flow.Direction.REPLACE); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment