Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

ViewModelLazy

class ViewModelLazy<VM : ViewModel> : Lazy<VM>
kotlin.Any
   ↳ androidx.lifecycle.ViewModelLazy

An implementation of Lazy used by androidx.fragment.app.Fragment.viewModels and androidx.activity.ComponentActivity.viewmodels.

storeProducer is a lambda that will be called during initialization, VM will be created in the scope of returned ViewModelStore.

factoryProducer is a lambda that will be called during initialization, returned ViewModelProvider.Factory will be used for creation of VM

Summary

Public constructors
<init>(viewModelClass: KClass<VM>, storeProducer: () -> ViewModelStore, factoryProducer: () -> ViewModelProvider.Factory)

An implementation of Lazy used by androidx.fragment.app.Fragment.viewModels and androidx.activity.ComponentActivity.viewmodels.

Public methods
Boolean

Properties
VM

Public constructors

<init>

ViewModelLazy(
    viewModelClass: KClass<VM>,
    storeProducer: () -> ViewModelStore,
    factoryProducer: () -> ViewModelProvider.Factory)

An implementation of Lazy used by androidx.fragment.app.Fragment.viewModels and androidx.activity.ComponentActivity.viewmodels.

storeProducer is a lambda that will be called during initialization, VM will be created in the scope of returned ViewModelStore.

factoryProducer is a lambda that will be called during initialization, returned ViewModelProvider.Factory will be used for creation of VM

Public methods

isInitialized

fun isInitialized(): Boolean

Properties

value

val value: VM