title: Simple navigation across navigation graphs with Android Navigation Architecture Component
body: <p>This is a simple example of a navigation setup that I can't get to work with the Navigation Component library, after researching for some time.</p>
  
  <p>Let's say I have the following screen:
  <a href="https://i.stack.imgur.com/zQK6x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zQK6x.png" alt="enter image description here"></a></p>
  
  <p>The sticky fragment at the top and the fragment at the bottom are in their own navigation graphs, here is the main_activity.xml:</p>
  
  <pre><code>&lt;androidx.constraintlayout.widget.ConstraintLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;fragment
          android:id="@+id/nav_sticky_top"
          android:name="androidx.navigation.fragment.NavHostFragment"
          android:layout_width="match_parent"
          android:layout_height="50dp"
          app:layout_constraintTop_toTopOf="parent"
          app:navGraph="@navigation/navigation_graph_sticky_top" /&gt;
  
      &lt;fragment
          android:id="@+id/navigation_host_fragment"
          android:name="androidx.navigation.fragment.NavHostFragment"
          android:layout_width="match_parent"
          android:layout_height="0dp"
          app:defaultNavHost="true"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintTop_toBottomOf="@id/nav_sticky_top"
          app:navGraph="@navigation/navigation_graph" /&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>When I press "navigate to sibling fragment" it navigates to the sibling fragment inside the bottom navigation graph, which is correct, the result:</p>
  
  <p><a href="https://i.stack.imgur.com/yY8wm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yY8wm.png" alt="enter image description here"></a></p>
  
  <p>This is the navigation_graph.xml: </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"
      android:id="@+id/navigation_graph.xml"
      app:startDestination="@id/blankFragment1"&gt;
  
      &lt;fragment
          android:id="@+id/blankFragment1"
          android:name="com.example.myapplication.BlankFragment1"
          android:label="fragment_blank_fragment1"
          tools:layout="@layout/fragment_blank_fragment1"&gt;
  
          &lt;action
              android:id="@+id/action_blankFragment1_to_siblingFragment"
              app:destination="@id/siblingFragment" /&gt;
  
      &lt;/fragment&gt;
  
      &lt;fragment
          android:id="@+id/siblingFragment"
          android:name="com.example.myapplication.SiblingFragment"
          tools:layout="@layout/fragment_sibling_fragment" /&gt;
  
  &lt;/navigation&gt;
  </code></pre>
  
  <p>Now I would like to implement the "Navigate to fullscreen fragment" button, which should navigate to a fullscreen fragment which is in a separate, third navigation graph and should be above the sticky fragment navigation graph and the navigation graph below that. How can this be properly achieved? By that I mean <strong>without</strong> hacks like setting the visibility of the top navigation graph fragment to GONE and navigating in the bottom navigation graph to the fullscreen fragment.</p>