injectedViewModel
ComponentActivity.viewModels that uses application's ViewModelProvider.Factory
Returns an existing ViewModel or creates a new one in the given owner (usually, a fragment or an activity), defaulting to the owner provided by LocalViewModelStoreOwner.
The created ViewModel is associated with the given viewModelStoreOwner and will be retained as long as the owner is alive (e.g. if it is an activity, until it is finished or process is killed).
If default arguments are provided via the CreationExtras, they will be available to the appropriate factory when the ViewModel is created.
Application's ViewModelProvider.Factory will be used to create the ViewModel.
Return
Parameters
The owner of the ViewModel that controls the scope and lifetime of the returned ViewModel. Defaults to using LocalViewModelStoreOwner.
The key to use to identify the ViewModel.
The default extras used to create the ViewModel.
Returns an existing ViewModel or creates a new one in the scope (usually, a fragment or an activity)
The created ViewModel is associated with the given viewModelStoreOwner and will be retained as long as the scope is alive (e.g. if it is an activity, until it is finished or process is killed).
If default arguments are provided via the CreationExtras, they will be available to the appropriate factory when the ViewModel is created.
Application's ViewModelProvider.Factory will be used to create the ViewModel.
Return
Parameters
The class of the ViewModel to create an instance of it if it is not present.
The scope that the created ViewModel should be associated with.
The key to use to identify the ViewModel.
The default extras used to create the ViewModel.
Fragment.viewModels that uses application's ViewModelProvider.Factory