Open junseokseo9306 opened 2 years ago
Error: jetpack navigation back stack is not connected with each bottom navigation section. upper error happened when the user travels one of the bottom navigation sections and then, clicks to the other bottom section.
Expectation :
back stack popup
whenever clicks other bottom navigation viewSolution :
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nav_home"
app:startDestination="@id/home">
<include app:graph="@navigation/home" />
<include app:graph="@navigation/record" />
<include app:graph="@navigation/community" />
<include app:graph="@navigation/user" />
</navigation>
navigation savestatehandle
to provide saved data to the planner fragmentplanner Fragment
navController.addOnDestinationChangedListener { _, destination, _ ->
when (destination.id) {
R.id.plannerFragment -> hideBottomNav()
R.id.exerciseSelectFragment -> hideBottomNav()
R.id.exerciseDetailFragment -> hideBottomNav()
else -> showBottomNav()
}}
Question:
🤷♂️ Description
📝 Primary Commits