Summary:
Protected Methods
| Inherited Methods
HiltViewModelFactory
public
final
class
HiltViewModelFactory
extends AbstractSavedStateViewModelFactory
java.lang.Object | ||
↳ | androidx.lifecycle.AbstractSavedStateViewModelFactory | |
↳ | androidx.hilt.lifecycle.HiltViewModelFactory |
View Model Provider Factory for the Hilt Extension.
A provider for this factory will be installed in the
ActivityComponent
and
FragmentComponent
. An instance of this factory will also
be the default factory by activities and fragments annotated with
AndroidEntryPoint
.
Summary
Protected methods | |
---|---|
<T extends ViewModel>
T
|
create(String key, Class<T> modelClass, SavedStateHandle handle)
Creates a new instance of the given |
Inherited methods | |
---|---|
Protected methods
create
protected T create (String key, Class<T> modelClass, SavedStateHandle handle)
Creates a new instance of the given Class
.
Parameters | |
---|---|
key |
String : a key associated with the requested ViewModel |
modelClass |
Class : a Class whose instance is requested |
handle |
SavedStateHandle : a handle to saved state associated with the requested ViewModel |
Returns | |
---|---|
T |
a newly created ViewModels |