Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 2.0.0
belongs to Maven artifact androidx.lifecycle:lifecycle-extensions:2.0.0-rc01
Deprecated since version 2.0.0

ViewModelStores

public class ViewModelStores
extends Object

java.lang.Object
   ↳ androidx.lifecycle.ViewModelStores


This class was deprecated in API level 2.0.0.
Use FragmentActivity.getViewModelStore() or Fragment.getViewModelStore() to retrieve a ViewModelStore directly from activities and fragments.

Factory methods for ViewModelStore class.

Summary

Public methods

static ViewModelStore of(Fragment fragment)

This method was deprecated in API level 2.0.0. Use Fragment.getViewModelStore()

static ViewModelStore of(FragmentActivity activity)

This method was deprecated in API level 2.0.0. Use FragmentActivity.getViewModelStore()

Inherited methods

Public methods

of

added in version 2.0.0
public static ViewModelStore of (Fragment fragment)

This method was deprecated in API level 2.0.0.
Use Fragment.getViewModelStore()

Returns the ViewModelStore of the given fragment.

Parameters
fragment Fragment: a fragment whose ViewModelStore is requested

Returns
ViewModelStore a ViewModelStore

of

added in version 2.0.0
public static ViewModelStore of (FragmentActivity activity)

This method was deprecated in API level 2.0.0.
Use FragmentActivity.getViewModelStore()

Returns the ViewModelStore of the given activity.

Parameters
activity FragmentActivity: an activity whose ViewModelStore is requested

Returns
ViewModelStore a ViewModelStore