does not have a NavController set on code example

Example: does not have a NavController set on 2131231008

// activity_main.xml
<fragment
       android:layout_width="match_parent"
       android:layout_height="match_parent"
        android:name="androidx.navigation.fragment.NavHostFragment"
       android:id="@+id/nav_host_fragment"
       app:navGraph="@navigation/mobile_navigation" />
         
// MainActivity.kt
val toolbar = findViewById<MaterialToolbar>(R.id.main_toolbar)
setSupportActionBar(toolbar)

Tags:

Java Example