lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey
added in version 1.1.0
belongs to Maven artifact android.arch.lifecycle:extensions:1.1.1

ViewModelStores

public class ViewModelStores
extends Object

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


Factory methods for ViewModelStore class.

Summary

Public methods

static ViewModelStore of(Fragment fragment)

Returns the ViewModelStore of the given fragment.

static ViewModelStore of(FragmentActivity activity)

Returns the ViewModelStore of the given activity.

Inherited methods

Public methods

of

added in version 1.1.0
ViewModelStore of (Fragment fragment)

Returns the ViewModelStore of the given fragment.

Parameters
fragment Fragment: a fragment whose ViewModelStore is requested

Returns
ViewModelStore a ViewModelStore

of

added in version 1.1.0
ViewModelStore of (FragmentActivity activity)

Returns the ViewModelStore of the given activity.

Parameters
activity FragmentActivity: an activity whose ViewModelStore is requested

Returns
ViewModelStore a ViewModelStore