ViewModelStores

open class ViewModelStores
kotlin.Any
   ↳ androidx.lifecycle.ViewModelStores

Factory methods for ViewModelStore class.

Summary

Public methods
open static ViewModelStore
of(activity: FragmentActivity)

Returns the ViewModelStore of the given activity.

open static ViewModelStore
of(fragment: Fragment)

Returns the ViewModelStore of the given fragment.

Public methods

of

open static fun of(activity: FragmentActivity): ViewModelStore

Returns the ViewModelStore of the given activity.

Parameters
activity FragmentActivity: an activity whose ViewModelStore is requested
Return
ViewModelStore: a ViewModelStore

of

open static fun of(fragment: Fragment): ViewModelStore

Returns the ViewModelStore of the given fragment.

Parameters
fragment FragmentActivity: a fragment whose ViewModelStore is requested
Return
ViewModelStore: a ViewModelStore