Class DefaultViewModelFactories
java.lang.Object
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories
Modules and entry points for the default view model factory used by activities and fragments
annotated with @AndroidEntryPoint.
Entry points are used to acquire the factory because injected fields in the generated activities and fragments are ignored by Dagger when using the transform due to the generated class not being part of the hierarchy during compile time.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe activity entry point to retrieve the factory.static interfaceThe fragment entry point to retrieve the factory.static final classInternal factory for the Hilt ViewModel Factory. -
Method Summary
Modifier and TypeMethodDescriptionstatic androidx.lifecycle.ViewModelProvider.FactorygetActivityFactory(androidx.activity.ComponentActivity activity, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.static androidx.lifecycle.ViewModelProvider.FactorygetFragmentFactory(androidx.fragment.app.Fragment fragment, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.
-
Method Details
-
getActivityFactory
public static androidx.lifecycle.ViewModelProvider.Factory getActivityFactory(androidx.activity.ComponentActivity activity, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.Do not use except in Hilt generated code!
-
getFragmentFactory
public static androidx.lifecycle.ViewModelProvider.Factory getFragmentFactory(androidx.fragment.app.Fragment fragment, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.Do not use except in Hilt generated code!
-