public class

FragmentScenario.FragmentFactoryHolderViewModel

extends ViewModel

 java.lang.Object

androidx.lifecycle.ViewModel

↳androidx.fragment.app.testing.FragmentScenario.FragmentFactoryHolderViewModel

Overview

A view-model to hold a fragment factory.

Summary

Constructors
publicFragmentFactoryHolderViewModel()

Methods
protected voidonCleared()

This method will be called when this ViewModel is no longer used and will be destroyed.

from ViewModeladdCloseable
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public FragmentFactoryHolderViewModel()

Methods

protected void onCleared()

This method will be called when this ViewModel is no longer used and will be destroyed.

It is useful when ViewModel observes some data and you need to clear this subscription to prevent a leak of this ViewModel.