title: Jetpack Navigation Deep Link with wrong ActionBar button
body: <p>When I open my application from the launcher icon, all the Navigation and ActionBar button works fine. But when I access the application from an explicit deep link, my ActionBar gets confused.</p>
  
  <p>My main navigation is:</p>
  
  <p><code>-&gt; [TaskListFragment] -&gt; [TaskDetailFragment]</code></p>
  
  <p>When opening by the launcher icon, the back button shows correctly:
  <a href="https://i.stack.imgur.com/euemn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/euemn.png" alt="Correct behavior"></a></p>
  
  <p>In my app, you can create an alarm for each task, so when the alarm rings and the user clicks on the notification, the flow is:</p>
  
  <p><code>-&gt; [TaskDetailFragment]</code></p>
  
  <p>Then, it shows the wrong button:
  <a href="https://i.stack.imgur.com/XOCEo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XOCEo.png" alt="Wrong behavior"></a>
  Clicking in the drawer icon, it returns to [TaskListFragment]. The behavior is correct, but the ActionBar icon is not.</p>
  
  <p>This is how I'm creating the deep link:</p>
  
  <pre><code>NavDeepLinkBuilder(context)
              .setGraph(R.navigation.nav_graph)
              .setDestination(R.id.taskDetailFragment)
              .setArguments(arguments)
              .createPendingIntent()
  </code></pre>
  
  <p>Here is the complete code on <a href="https://github.com/igorescodro/alkaa/tree/v1.3.1" rel="nofollow noreferrer">GitHub</a>.</p>
  
  <p><a href="https://github.com/igorescodro/alkaa/blob/v1.3.1/app/src/main/java/com/escodro/alkaa/ui/main/MainActivity.kt" rel="nofollow noreferrer">MainActivity</a> with all the Navigation boilerplate.</p>
  
  <p>And <a href="https://github.com/igorescodro/alkaa/blob/v1.3.1/app/src/main/res/navigation/nav_graph.xml" rel="nofollow noreferrer">my Navigation Graph</a>.</p>
  
  <p>I also tried several base implementation, such as Google's <a href="https://github.com/googlesamples/android-architecture-components" rel="nofollow noreferrer">Sunflower</a> and Architecture Components Sample without success.</p>