To transfer additional arguments/parameters for ViewModel we used ViewModelFactory. For example
ExtraParamsViewModelFactory(this.requireActivity().application, "some string value")
But when the ViewModel is created, I can’t change the arguments/parameters dynamically
val myViewModel = ViewModelProvider(this, ExtraParamsViewModelFactory(this.requireActivity().application, "some string value")).get(SomeViewModel::class.java)
"some string value" becomes harcoded in fragment/activity class. In "some string value" I need to pass a date that is always different to ViewModel. In the fragment, the user selected a date, clicked on the button and this date as a arguments/parameters pass to ViewModel. Not suitable for this ViewModelFactory?