ViewModelStores


public class ViewModelStores


Factory methods for ViewModelStore class.

Summary

Public methods

static @NonNull ViewModelStore

This method is deprecated.

Use getViewModelStore

static @NonNull ViewModelStore

This method is deprecated.

Use getViewModelStore

Public methods

of

Added in 2.0.0
Deprecated in 2.0.0
@MainThread
public static @NonNull ViewModelStore of(@NonNull FragmentActivity activity)

Returns the ViewModelStore of the given activity.

Parameters
@NonNull FragmentActivity activity

an activity whose ViewModelStore is requested

Returns
@NonNull ViewModelStore

a ViewModelStore

of

Added in 2.0.0
Deprecated in 2.0.0
@MainThread
public static @NonNull ViewModelStore of(@NonNull Fragment fragment)

Returns the ViewModelStore of the given fragment.

Parameters
@NonNull Fragment fragment

a fragment whose ViewModelStore is requested

Returns
@NonNull ViewModelStore

a ViewModelStore