I am making A Trivia app following Udacity Android with Kotlin guide.
In Navigation Graph there are three destination screen; TitleFragment, GameFragment,GameOverFragment and GameWonFragment. (Images for code are included)
While constructing Navigation graph, we are setting up for system back key by setting popUpTo behavior attribute.
The guide says us to setup popUpTo (inclusive) attribute for action connecting GameFragment to GameOverFragment and GameWonFragment which will lead back to TitleFragment by popping up fragments including GameFragment on system back button hit. I understood till here.
But again the guide tells us to set action tag and popUpTo attribute from GameOverFragment and GameWonFragment to GameFragment. This time we wet popUpTo attribute(exclusive) for popping upto TitleFragment on system back key hit.
Both set up are doing same thing; taking us to TitleFragment on System back key hit. So, why setting up 2 times is necessary?