LG
07/01/2021, 8:27 PMv.3.1
and I have some issue with the injection of the SavedStateHandle
in my ViewModel
When my viewmodel is called for the first time in my Fragment, I received a new SavedStateHandle and not the one I see from the Fragment
Does anyone have an idea
Here’s the code:
VM
class ArticleViewModel(
private val savedStateHandle: SavedStateHandle,
private val useCase: ArticleUseCase) : ViewModel() {
AppModule
viewModel { ArticleViewModel(get(), get()) }
arnaud.giuliani
07/02/2021, 7:52 AMarnaud.giuliani
07/02/2021, 7:52 AMLG
07/02/2021, 12:07 PMprivate val articleViewModel: ArticleViewModel by stateViewModel()
arnaud.giuliani
07/02/2021, 12:25 PMstate
parameter inside stateViewModel.
You can pass a function that return your bundle