public interface

ViewModelProvider.Factory

 androidx.lifecycle.ViewModelProvider.Factory

Subclasses:

ViewModelProvider.NewInstanceFactory, ViewModelProvider.AndroidViewModelFactory, ViewModelProviders.DefaultFactory, SavedStateViewModelFactory, AbstractSavedStateViewModelFactory, DocumentListModel.DocumentListModelFactory, SchemaTypeListModel.SchemaTypeListModelFactory, DocumentModel.DocumentModelFactory, HiltViewModelFactory

Overview

Implementations of Factory interface are responsible to instantiate ViewModels.

Summary

Methods
public ViewModelcreate(java.lang.Class<ViewModel> modelClass)

Creates a new instance of the given Class.

Methods

public ViewModel create(java.lang.Class<ViewModel> modelClass)

Creates a new instance of the given Class.

Parameters:

modelClass: a Class whose instance is requested

Returns:

a newly created ViewModel