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(@NonNull Class<@NonNull T> modelClass)

Creates a new instance of the given Class.

Public methods

create

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

Creates a new instance of the given Class.

Parameters
@NonNull Class<@NonNull T> modelClass

a Class whose instance is requested

Returns
T

a newly created ViewModel