Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

Factory

interface Factory
androidx.lifecycle.ViewModelProvider.Factory

Implementations of Factory interface are responsible to instantiate ViewModels.

Summary

Public methods
abstract T
create(@NonNull modelClass: Class<T>)

Creates a new instance of the given Class.

Public methods

create

@NonNull abstract fun <T : ViewModel!> create(@NonNull modelClass: Class<T>): T

Creates a new instance of the given Class.

Parameters
modelClass Class<T>: a Class whose instance is requested
<T> The type parameter for the ViewModel.
Return
T a newly created ViewModel