ViewModelStores

public class ViewModelStores
extends Object

java.lang.Object
   ↳ androidx.lifecycle.ViewModelStores


This class is deprecated.
Use ComponentActivity.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 is deprecated. Use Fragment.getViewModelStore()

static ViewModelStore of(FragmentActivity activity)

This method is deprecated. Use ComponentActivity.getViewModelStore()

Inherited methods

Public methods

of

public static ViewModelStore of (Fragment fragment)

This method is deprecated.
Use Fragment.getViewModelStore()

Returns the ViewModelStore of the given fragment.

Parameters
fragment Fragment: a fragment whose ViewModelStore is requested

Returns
ViewModelStore a ViewModelStore

of

public static ViewModelStore of (FragmentActivity activity)

This method is deprecated.
Use ComponentActivity.getViewModelStore()

Returns the ViewModelStore of the given activity.

Parameters
activity FragmentActivity: an activity whose ViewModelStore is requested

Returns
ViewModelStore a ViewModelStore