诊所App中Navigation Drawer与Navigation Component的问题求助
Hey folks, I'm working on a clinic Android App built on top of a project with integrated Navigation Drawer. I've added several Fragments to it, but two tricky issues have me stuck:
1. Incorrect Back Navigation Behavior
When I navigate from visitsFragment to addVisitFragment, tapping the back arrow in the top-left corner takes me back to the default Fragment instead of visitsFragment—this isn't the expected flow I want.
2. Fragment Overlaps Instead of Being Replaced
During the same navigation action, addVisitFragment gets stacked on top of the original Fragment rather than replacing it. I can confirm this because tapping specific areas triggers dialogs that belong to the underlying Fragment.
I have my project files ready for anyone who can help troubleshoot these problems. Also, if fixing the above issues turns out to be too complex, I'd also appreciate guidance on switching the back arrow back to the Navigation Drawer toggle icon that properly opens the drawer.
内容的提问来源于stack exchange,提问作者user11621177

