Hilt creating different instances of view model inside same activity
问题 After recently migrating from Dagger to Hilt I started observing very strange behavior with respect to ViewModels. Below is the code snippet: @HiltAndroidApp class AndroidApplication : Application() {} @Singleton class HomeViewModel @ViewModelInject constructor() : ViewModel() {} @AndroidEntryPoint class HomeFragment : Fragment(R.layout.fragment_home) { private val homeViewModel by viewModels<HomeViewModel>() override fun onResume() { super.onResume() Timber.i("hashCode: ${homeViewModel