Jetpack Navigation: Getting Started

Aug 10 2021 · Kotlin 1.4, Android 11, Android Studio 4.2.1

Part 2: Create Destinations & Navigate via Actions

05. Add Start Destination & NavHost Interface

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 04. Create a Navigation Graph Next episode: 06. Add Destinations & Navigate via Action

Notes: 05. Add Start Destination & NavHost Interface

Learn about Principles of Navigation and Creating Activity as Destination.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

Open navigation graph in starter project. Click New Destination icon. You get a list which displays available activities and fragments in the app.

  <androidx.fragment.app.FragmentContainerView
    android:id="@+id/nav_host_fragment"
    android:name="androidx.navigation.fragment.NavHostFragment"
    android:layout_width="0dp"
    android:layout_height="0dp"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:defaultNavHost="true"
    app:navGraph="@navigation/nav_graph" />