ViewModelStore
-
Cmn
open class ViewModelStore
Class to store ViewModels.
Instances of ViewModelStore must be retained through configuration changes. If the owner of a ViewModelStore, typically a `ViewModelStoreOwner`, is destroyed and recreated due to a configuration change, the new owner must have the old instance of the ViewModelStore.
If the owner of a ViewModelStore is destroyed and is not going to be recreated, it should call `clear` on this ViewModelStore so that The ViewModels stored by it are notified that they are no longer needed.
Use `ViewModelStoreOwner.getViewModelStore` to retrieve a ViewModelStore for activities and fragments.
Summary
Public constructors |
|
|---|---|
|
Cmn
|
Public functions |
||
|---|---|---|
Unit |
clear()Clears internal storage and notifies |
Cmn
|