Google 致力于为黑人社区推动种族平等。查看具体举措

HiltViewModelFactory

class HiltViewModelFactory : AbstractSavedStateViewModelFactory
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 dagger.hilt.android.components.ActivityComponent and dagger.hilt.android.components.FragmentComponent. An instance of this factory will also be the default factory by activities and fragments annotated with dagger.hilt.android.AndroidEntryPoint.

Summary

Protected methods
T
create(@NonNull key: String, @NonNull modelClass: Class<T>, @NonNull handle: SavedStateHandle)

Inherited functions

Protected methods

create

@NonNull protected fun <T : ViewModel!> create(
    @NonNull key: String,
    @NonNull modelClass: Class<T>,
    @NonNull handle: SavedStateHandle
): T