dependencies { implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation 'com.example:library:1.0.0' } <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.example.app.HomeFragment" /> <fragment android:id="@+id/libraryFragment" android:name="com.example.library.LibraryFragment" /> </navigation> val navController = view.findNavController() navController.navigate(R.id.libraryFragment)


上一篇:
下一篇:
切换中文