Consider the following scenario:
I have an Android application with three screens: a list of items, a search results screen, and a show item screen. A search bar can be invoked on every screen, and the search bar will either take you to search results screen or directly to an item screen if autocomplete finds a perfect match.
Now, the questions is, how should the flow between screen be organised? The simple flow is easy: list > search > results > show. Clicking the back button in either state moves one item down the stack.
However, what if search is invoked from the show screen? The stack would then be list > search > results > show > search > results. And we could possibly end up with a tall stack of search results and show screen.
I'm considering making the flow such that whenever you invoke the search bar (and perform a search), any show screens are removed from the stack, and the stack will never be more complex than the simple list > search > results > show.
I guess the core of the question is whether a user invoking the search bar from a show screen mentally "goes back to search" or "moves on to the next search", and thus might expect the first show screen to be accessible or not.
The IMDb app for Android follows the latter approach, easily building a stack of tens of screens, and I'm personally not thrilled about this.