added in version 1.0.0
belongs to Maven artifact android.arch.lifecycle:viewmodel:1.1.1

ViewModelStore

public class ViewModelStore
extends Object

java.lang.Object
   ↳ android.arch.lifecycle.ViewModelStore


Class to store ViewModels.

An instance of ViewModelStore must be retained through configuration changes: if an owner of this ViewModelStore is destroyed and recreated due to configuration changes, new instance of an owner should still have the same old instance of ViewModelStore.

If an owner of this ViewModelStore is destroyed and is not going to be recreated, then it should call clear() on this ViewModelStore, so ViewModels would be notified that they are no longer used.

ViewModelStores provides a ViewModelStore for activities and fragments.

Summary

Public constructors

ViewModelStore()

Public methods

final void clear()

Clears internal storage and notifies ViewModels that they are no longer used.

Inherited methods

Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait(long arg0, int arg1)
final void wait(long arg0)
final void wait()

Public constructors

ViewModelStore

added in version 1.0.0
ViewModelStore ()

Public methods

clear

added in version 1.0.0
void clear ()

Clears internal storage and notifies ViewModels that they are no longer used.