ViewModelProvider.Factory

interface ViewModelProvider.Factory

Known direct subclasses
ViewModelProvider.NewInstanceFactory

Simple factory, which calls empty constructor on the give class.


Implementations of Factory interface are responsible to instantiate ViewModels.

Summary

Public methods

abstract @NonNull T
<T extends ViewModel> create(Class<T> modelClass)

Creates a new instance of the given Class.

Public methods

create

abstract @NonNull T <T extends ViewModel> create(Class<T> modelClass)

Creates a new instance of the given Class.

Parameters
Class<T> modelClass

a Class whose instance is requested

Returns
@NonNull T

a newly created ViewModel