title: android architecture navigation OnNavigatedListener with backstack
body: <p>I would like to use <a href="https://developer.android.com/reference/androidx/navigation/NavController.OnNavigatedListener" rel="nofollow noreferrer">NavController.OnNavigatedListener</a> to log destinations changing events. The problem is that when some fragment is saved in backstack than for every navigation change is <code>onNavigated</code> called ones more and destination is that fragment which is saved in backstack. I need to filter this events, but I don't know how. I was trying to find something usefull in <code>destination</code> but I found nothing.</p>
  
  <pre><code>class MyOnNavigatedListener() : NavController.OnNavigatedListener {
  
  override fun onNavigated(controller: NavController, destination: NavDestination) {
  //log events
  }
  </code></pre>
  
  <p>}</p>