title: Navigation Component should initialize fragment once
body: <p>I want to load all fragment once or on first click. I don't want to recreate fragment on clicking bottom menu</p>
  <p><strong>MainActivity.kt</strong></p>
  <pre><code>@AndroidEntryPoint
  class MainActivity : AppCompatActivity() {
  
      private lateinit var binding: ActivityMainBinding
      private lateinit var navController:NavController
      private lateinit var appBarConfiguration:AppBarConfiguration
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
  
          binding = ActivityMainBinding.inflate(layoutInflater)
          setContentView(binding.root)
          supportActionBar?.hide()
          val navView: BottomNavigationView = binding.navView
  
          val navHostFragment =
              supportFragmentManager.findFragmentById(R.id.nav_host_fragment_activity_main) as NavHostFragment
          navController = navHostFragment.navController
          appBarConfiguration = AppBarConfiguration(
              setOf(
                  R.id.navigation_home, R.id.navigation_campaigns, R.id.navigation_credits,R.id.navigation_masks,R.id.navigation_messages
              )
          )
          setupActionBarWithNavController(navController, appBarConfiguration)
          navView.setupWithNavController(navController)
      }
      override fun onSupportNavigateUp(): Boolean {
          return NavigationUI.navigateUp(navController, appBarConfiguration)
      }
  }
  </code></pre>