I have integrated Navigation component in my app. I'm using it along with Bottom Navigation.
I have 3 tabs [Home, Notification, Account]. Switching the navigation is working perfectly fine.
Problem for me lies here.
From Home fragment the app navigates to many other fragments Home -> FragA -> FragB -> FragC. But when i click on the Home icon in bottom navigation, I want to clear all the Fragments and come to the initial state.
Currently Im coming to the home screen, but when i click back all previous fragments FragA -> FragB -> FragC are showing up.
How can this be achieved?
Not attaching any code as it's irrelevant