title: How to determine back button press
body: <p>I am using android navigation components library. I have two fragments set up with navigation graph. I want to do some additional actions on back button press inside of my fragment.</p>
  
  <pre><code>override fun onOptionsItemSelected(item: MenuItem): Boolean {
      return NavigationUI.onNavDestinationSelected(item, view!!.findNavController())
             || super.onOptionsItemSelected(item)
  }
  </code></pre>
  
  <p>I use this code to handle toolbar up button click, but I also want to handle back button press. How can I do this?</p>