ViewModelStore
-
Cmn
open class ViewModelStore
Stores ViewModel instances by key.
A ViewModelStore instance must be retained across configuration changes. If an owner (typically a ViewModelStoreOwner) is destroyed and recreated due to a configuration change, the new owner must reuse the previous ViewModelStore instance.
When the owner is being destroyed permanently (i.e., it will not be recreated), it should call clear to notify all stored ViewModel instances that they are no longer needed (see ViewModel.onCleared).
Use ViewModelStoreOwner.viewModelStore to retrieve a ViewModelStore for activities and fragments.
Not stable for inheritance
This class is not intended for inheritance. It is technically open for binary compatibility with previous versions, but extending this class is unsupported.
Summary
Public constructors |
|
|---|---|
|
Cmn
|
Public functions |
||
|---|---|---|
Unit |
clear()Clears this store and notifies all stored |
Cmn
|
open String |
toString() |
Cmn
|