Skip to content

Instantly share code, notes, and snippets.

@oliverspryn
Last active June 20, 2019 20:02
Show Gist options
  • Select an option

  • Save oliverspryn/f1b59a9384ee4afc14e94d7fecbaf21e to your computer and use it in GitHub Desktop.

Select an option

Save oliverspryn/f1b59a9384ee4afc14e94d7fecbaf21e to your computer and use it in GitHub Desktop.
Implements a custom navigator host in an activity
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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:layout_height="match_parent"
android:layout_width="match_parent">
<fragment
android:id="@+id/navigation_host"
android:name="com.example.MyNavHostFragment"
android:layout_height="match_parent"
android:layout_width="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/main_graph"
tools:context=".MainActivity" />
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment