https://developer.android.com/guide/nav ... ng-started
Код: Выделить всё
navController = findNavController(R.id.nav_host_fragment)
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.navigation_opt1,
R.id.navigation_opt2,
R.id.navigation_opt3,
R.id.navigation_more
)
)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
Код: Выделить всё
val ftr: FragmentTransaction = requireFragmentManager().beginTransaction()
ftr.detach(this).attach(this).commit()
Подробнее здесь: https://stackoverflow.com/questions/638 ... -component
Мобильная версия