AbstractSavedStateViewModelFactory

public abstract class AbstractSavedStateViewModelFactory
extends ViewModelProvider.KeyedFactory

java.lang.Object
   ↳ androidx.lifecycle.ViewModelProvider.OnRequeryFactory
     ↳ androidx.lifecycle.ViewModelProvider.KeyedFactory
       ↳ 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(SavedStateRegistryOwner owner, Bundle defaultArgs)

Constructs this factory.

Public methods

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