{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ViewModelStoreOwner

public interface ViewModelStoreOwner


A scope that owns ViewModelStore.

A responsibility of an implementation of this interface is to retain owned ViewModelStore during the configuration changes and call ViewModelStore.clear, when this scope is going to be destroyed.

See also
ViewTreeViewModelStoreOwner

Summary

Public methods

abstract @NonNull ViewModelStore

The owned ViewModelStore

Public methods

getViewModelStore

abstract @NonNull ViewModelStore getViewModelStore()

The owned ViewModelStore