title: Handling back button in Android Navigation Component
body: <p>I'd like to know how properly handle system back button action using Navigation Controller. In my app I have two fragments (for ex. fragment1 and fragment2) and I have an action in fragment1 with destination to fragment2. Everything works well except one thing - when user presses system back button in fragment2 I want to show a dialog (using DialogFragment for example) to confirm exit. What is the best way to implement this behavior? If I use <code>app:defaultNavHost="true"</code> in my host fragment then it automatically goes back ignoring my rules. And, additionally, what is this component for?</p>
  
  <p><a href="https://i.stack.imgur.com/NjZ75.png" rel="noreferrer"><img src="https://i.stack.imgur.com/NjZ75.png" alt="enter image description here"></a></p>
  
  <p>Should I use "pop to" may be?</p>