Skip to content

Instantly share code, notes, and snippets.

@ErikMedina
Last active December 23, 2021 18:50
Show Gist options
  • Save ErikMedina/d530c66fd981dc29c969e606d677531e to your computer and use it in GitHub Desktop.
Save ErikMedina/d530c66fd981dc29c969e606d677531e to your computer and use it in GitHub Desktop.
Forward destinations
<?xml version="1.0" encoding="utf-8"?>
<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/nav_graph"
app:startDestination="@id/homeFragment">
<fragment
android:id="@+id/homeFragment"
android:name="com.erikmedina.navigationcomponent.HomeFragment"
android:label="fragment_first"
tools:layout="@layout/fragment_home">
<action
android:id="@+id/action_homeFragment_to_firstFragment"
app:destination="@id/firstFragment" />
</fragment>
<fragment
android:id="@+id/firstFragment"
android:name="com.erikmedina.navigationcomponent.FirstFragment"
tools:layout="@layout/fragment_first">
<action
android:id="@+id/action_firstFragment_to_secondFragment"
app:destination="@id/secondFragment" />
</fragment>
<fragment
android:id="@+id/secondFragment"
android:name="com.erikmedina.navigationcomponent.SecondFragment"
tools:layout="@layout/fragment_second">
<action
android:id="@+id/action_secondFragment_to_thirdFragment"
app:destination="@id/thirdFragment" />
</fragment>
<fragment
android:id="@+id/thirdFragment"
android:name="com.erikmedina.navigationcomponent.ThirdFragment"
tools:layout="@layout/fragment_third" />
</navigation>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment