AbstractSavedStateViewModelFactory

public abstract class AbstractSavedStateViewModelFactory
extends ViewModelProvider.OnRequeryFactory implements ViewModelProvider.Factory

java.lang.Object
   ↳ androidx.lifecycle.ViewModelProvider.OnRequeryFactory
     ↳ androidx.lifecycle.AbstractSavedStateViewModelFactory


Skeleton of androidx.lifecycle.ViewModelProvider.KeyedFactory that creates SavedStateHandle for every requested ViewModel. The subclasses implement create(String, Class, SavedStateHandle) to actually instantiate androidx.lifecycle.ViewModels.

Summary

Public constructors

AbstractSavedStateViewModelFactory()

Constructs this factory.

AbstractSavedStateViewModelFactory(SavedStateRegistryOwner owner, Bundle defaultArgs)

Constructs this factory.

Public methods

final <T extends ViewModel> T create(Class<T> modelClass, CreationExtras extras)
final <T extends ViewModel> T create(Class<T> modelClass)

Protected methods

abstract <T extends ViewModel> T create(String key, Class<T> modelClass, SavedStateHandle handle)

Creates a new instance of the given Class.

Inherited methods