ViewModelStores

class ViewModelStores


Factory methods for ViewModelStore class.

Summary

Public functions

java-static ViewModelStore

This function is deprecated.

Use getViewModelStore

java-static ViewModelStore
@MainThread
of(fragment: Fragment)

This function is deprecated.

Use getViewModelStore

Public functions

of

Added in 2.0.0
Deprecated in 2.0.0
@MainThread
java-static fun of(activity: FragmentActivity): ViewModelStore

Returns the ViewModelStore of the given activity.

Parameters
activity: FragmentActivity

an activity whose ViewModelStore is requested

Returns
ViewModelStore

a ViewModelStore

of

Added in 2.0.0
Deprecated in 2.0.0
@MainThread
java-static fun of(fragment: Fragment): ViewModelStore

Returns the ViewModelStore of the given fragment.

Parameters
fragment: Fragment

a fragment whose ViewModelStore is requested

Returns
ViewModelStore

a ViewModelStore