title: NavController.OnDestinationChangedListener passes a destination.id not matching the triggered Navigation Action ID
body: <p>In my Android project I have a very simple Navigation Graph, including two fragments: Master and Detail:</p>
  
  <pre><code>&lt;navigation xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     app:startDestination="@id/wordsListFragment"&gt;
  
      &lt;fragment
          android:id="@+id/wordsListFragment"
          android:name="com.***.presentation.view.WordsListFragment"
          android:label="List"
          tools:layout="@layout/words_list_fragment"&gt;
          &lt;action
              android:id="@+id/action_wordsListFragment_to_wordDetailsFragment"
              app:destination="@id/wordDetailsFragment" /&gt;
      &lt;/fragment&gt;
      &lt;fragment
          android:id="@+id/wordDetailsFragment"
          android:name="com.***.presentation.view.WordDetailsFragment"
          android:label="Details"
          tools:layout="@layout/word_details_fragment" /&gt;
  &lt;/navigation&gt;
  </code></pre>
  
  <p>The navigation itself works perfectly fine in both directions including the "Back" behaviour.
  In that project I have a single activity where I implement <code>OnDestinationChangedListener</code>. 
  All this according to the following documentation from Google: <a href="https://developer.android.com/guide/navigation/navigation-ui#listen_for_navigation_events" rel="noreferrer">NavController Updating UI</a></p>
  
  <p>I call the following method when the user clicks on a list item (while being on the master fragment):</p>
  
  <pre><code>findNavController().navigate(R.id.action_wordsListFragment_to_wordDetailsFragment, null)
  </code></pre>
  
  <p>Then in the parent activity I have the following implementation:</p>
  
  <pre><code>private fun setupNavController() {
      navigationController = findNavController(R.id.nav_mainhost_fragment_container)
      navigationController.addOnDestinationChangedListener(mainDestinationChangedListener)
      appBarConfiguration = AppBarConfiguration(navigationController.graph)
      setupActionBarWithNavController(navigationController, appBarConfiguration)
  }
  </code></pre>
  
  <p>and that is the listener object:</p>
  
  <pre><code>private val mainDestinationChangedListener = 
  NavController.OnDestinationChangedListener { controller, destination, arguments -&gt;        
  
  if (destination.id == R.id.action_wordsListFragment_to_wordDetailsFragment) {
          actionBar?.hide()
      } else {
          actionBar?.show()
      }
  }
  </code></pre>
  
  <p>but the <code>destination.id</code> does not match the <code>R.id.action_wordsListFragment_to_wordDetailsFragment</code></p>
  
  <p>I have tried to clean up the project, clean up the IDE cache, the gradle cache, but the generated identifiers still does not match. I have also tried to use Navigation via Safe Args:</p>
  
  <pre><code>val action = WordsListFragmentDirections.actionWordsListFragmentToWordDetailsFragment()
  findNavController().navigate(action)
  </code></pre>
  
  <p>but the results in the given listener are always the same (i.e. not matching).</p>
  
  <p>Some values from debugging:</p>
  
  <pre><code>findNavController().navigate(1000021) //R.id.action_wordsListFragment_to_wordDetailsFragment
  </code></pre>
  
  <p>but the next call on stack has another value:
  <a href="https://i.stack.imgur.com/29z8z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/29z8z.png" alt="enter image description here"></a>
  what also matches the <code>destination.id</code> values passed to the <code>OnDestinationChangedListener</code>:</p>
  
  <pre><code>destination.id //2131231018
  </code></pre>
  
  <p>Any hints from your side are more than welcome. I just want to recognise the destination or the action ID and adjust the ToolBar accordingly.</p>