In Fragment, we can use ViewModel scoped to navigation Graph.
private val viewModel: ViewModel by navGraphViewModels(R.id.youNavGraphID)
But how to create ViewModel with navGraph scope in Activity? Or is it any way to make the ViewModel scoped to navigation graph in Activity? I need to recreate the ViewModel object instance after the navigation graph is destroyed.
Thanks.