I'm using Jetpack Navigation Component with BottomNavigationView in my app. The application is something looks like this image:
The app has 4 destinations:
- Home
- Categories
- Account
- Search(I open it when the user clicks on the search icon in the toolbar, also it shows in all destinations)
When the user clicks on Product1, I show him/her Product1 details in another destination and if then the user clicks on the search icon the search destination will open and if he/she clicks on the back button I want to show him Product1 Detail destination but by default, the app shows Home destination. How can I fix it? I have many issues with the Jetpack Navigation Component back stack because it does not behave as expected. Also, I've read many articles and questions but they did not help me.