title: How to create a start destination of navigation graph programmatically in Fragment?
body: <p>I have a host (activity) which contains 5 fragments and one of the fragment also acts like a host (nested graph) contains 2 fragments. I want to create a start destination dynamically in this host fragment.</p>
  
  <p>I created the start destination dynamically in activity but can't create in fragment as it can't refer the id of nav host.</p>
  
  <p>In activity I did this:</p>
  
  <pre><code>    val navHostFragment = nav_host_fragment as NavHostFragment
      val navController = navHostFragment.navController
      val navInflater = navController.navInflater
      val graph = navInflater.inflate(R.navigation.nav_main)
      graph.startDestination = R.id.detail_fragment
      val navShipmentId = NavArgument.Builder().setDefaultValue(shipmentId).build()
      navHostFragment.navController.graph = graph
  </code></pre>