title: Replace fragment on nav host without destroying
body: <p>I am using Android Jetpack Navigation to navigate between fragments in my App and using a single Main Activity. I have a nav host fragment in main activity and a bottom navigation to naviagte between fragments.</p>
  
  <pre><code>navController = Navigation.findNavController(this,R.id.nav_host_fragment_container);
  BottomNavigationView bottomNavigationView = findViewById(R.id.bot_nav_bar);
  NavigationUI.setupWithNavController(bottomNavigationView,navController);
  </code></pre>
  
  <p>But I have a major issue - whenever I navigate to another fragment, the current fragment is destroyed and when I navigate back, it is recreated, along with the view model. Then the view model again fetches the data from the repository. </p>
  
  <p>How can I fix this issue. I want to navigate between the tabs and load other fragments without destroying the current one.</p>