title: Fragment not being restored from backstack, also Hilt recreating ViewModel with Fragment's lifecycle
body: <p>I wanted ViewModel to store bundle of data to save state of Fragment's View since ViewModel is independent of Fragment and its View, but shouldn't save the state as deeply as <code>onSaveInstanceState(outBundle: Bundle)</code> does (save state of EditTexts etc when you navigate throught the app, but no need to handle process death). So I created nullable Bundle property in ViewModel that should do the job (when <code>onDestroyView()</code> is invoked Bundle of data is passed to ViewModel, then in <code>onCreateView(...)</code> I'm reading it, and if it's null then you're in this destination for the first time), but it kept being null.</p>
  <p>With the help of Debugging and Logs i figured out that when you navigate throught the app with use of BottomNavigationView and NavigationComponent, Hilt creates new Instance of Fragment, new instance of ViewModel, and then the fragment that should be restored from backstack is being destroyed.</p>
  <p>Here are logs that prove it (navigate to another destination and navigate back)</p>
  <pre><code>2020-11-24 12:14:31.770 I: Fragment hash code - 160176487: onCreate
  2020-11-24 12:14:31.844 I: Fragment hash code - 160176487: VM hash code - 167331582
  2020-11-24 12:14:36.264 I: Fragment hash code - 184547386: onCreate
  2020-11-24 12:14:36.265 I: Fragment hash code - 184547386: VM hash code - 182438472
  2020-11-24 12:14:36.385 I: Fragment hash code - 160176487: onDestroy
  </code></pre>
  <p>It happens only with navigation by BottomNavigationView. When I navigate with <code>findNavController().navigate(...)</code> fragments are restored properly, even adapter position of RecyclerView is being restored.</p>
  <p>Shouldn't NavigationComponent restore Fragment from the backstack, and shouldn't ViewModel be independent of Fragment and live throught navigation? And why Hilt creates new instances of ViewModels when they should live throught whole app lifecycle since I didn't scope them to any component or module? Or there is a way to be sure ViewModel is independent?</p>
  <p>ViewModel:</p>
  <pre><code>class ExploreFragmentViewModel @ViewModelInject constructor(...) : ViewModel()
  </code></pre>
  <p>Fragment:</p>
  <pre><code>@AndroidEntryPoint 
  class ExploreFragment : Fragment() {
      ...
      private val viewModel: ExploreFragmentViewModel by viewModels()
      ...
  }
  </code></pre>
  <p>How i setup BottomNavigationView with NavigationComponent in single Activity pattern:</p>
  <pre><code>val navController = findNavController(R.id.fragment)
  binding.bottomNavBar.setupWithNavController(navController)
  </code></pre>