ViewModelStores


Factory methods for ViewModelStore class.

Summary

Public functions

java-static ViewModelStore

This function is deprecated.

Use getViewModelStore

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

This function is deprecated.

Use getViewModelStore

android

Public functions

of

@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

@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