title: Fragment savedInstanceState is always null when using Navigation Component
body: <p>Currently, I am playing around Android Navigation Component with Bottom Navigation Bar. While playing I realized two facts:</p>
  <ul>
  <li>Fragments are always recreated (<code>onCreate</code>, <code>onViewCreated</code>, <code>onViewDestroyed</code> are called as soon as the user navigates to another fragment)</li>
  <li><code>savedInstanceState</code> is always null (in <code>onCreate</code>, <code>onViewCreated</code>, etc.)</li>
  </ul>
  <p>The first issue can be fixed by using custom <code>FragmentNavigator</code>, which will reuse fragment if it already exists</p>
  <pre class="lang-kotlin prettyprint-override"><code>package am.chamich.apps.advancedbottomnavigation.navigator
  
  import android.content.Context
  import android.os.Bundle
  import androidx.navigation.NavDestination
  import androidx.navigation.NavOptions
  import androidx.navigation.Navigator
  import androidx.navigation.fragment.FragmentNavigator
  
  
  @Navigator.Name(&quot;retain_state_fragment&quot;)
  class RetainStateFragmentNavigator(
      private val context: Context,
      private val manager: androidx.fragment.app.FragmentManager,
      private val containerId: Int
  ) : FragmentNavigator(context, manager, containerId) {
  
      override fun navigate(
          destination: Destination,
          args: Bundle?,
          navOptions: NavOptions?,
          navigatorExtras: Navigator.Extras?
      ): NavDestination? {
          val tag = destination.id.toString()
          val transaction = manager.beginTransaction()
  
          val currentFragment = manager.primaryNavigationFragment
          if (currentFragment != null) {
              transaction.detach(currentFragment)
          }
  
          var fragment = manager.findFragmentByTag(tag)
          if (fragment == null) {
              val className = destination.className
              fragment = instantiateFragment(context, manager, className, args)
              transaction.add(containerId, fragment, tag)
          } else {
              transaction.attach(fragment)
          }
  
          transaction.setPrimaryNavigationFragment(fragment)
          transaction.setReorderingAllowed(true)
          transaction.commit()
  
          return destination
      }
  }
  </code></pre>
  <h3>Question</h3>
  <p>For the second issue, I have no idea how to fix it, actually, I even didn't understand how the fragment is restoring its state (for example when you rotate the screen), I tied to use <code>fragment.setInitialSavedState(savedState)</code> to save and restore fragment state, but that doesn't help in this situation.</p>
  <p><strong>Actually what I need to know is when fragment view was recreated</strong></p>
  <p>Here is a <a href="https://github.com/ChamichApps/Advanced-Bottom-Navigation" rel="noreferrer">link</a> to my GitHub project, any help is welcome.</p>