ViewTreeSavedStateRegistryOwner

public final class ViewTreeSavedStateRegistryOwner
extends Object

java.lang.Object
   ↳ androidx.savedstate.ViewTreeSavedStateRegistryOwner


Accessors for finding a view tree-local SavedStateRegistryOwner that allows managing the saving state using SavedStateRegistry for the given view.

Summary

Public methods

static SavedStateRegistryOwner get(View view)

Retrieve the SavedStateRegistryOwner responsible for managing the saved state for the given View.

static void set(View view, SavedStateRegistryOwner owner)

Set the SavedStateRegistryOwner responsible for managing the saved state for the given View.

Inherited methods

Public methods

get

public static SavedStateRegistryOwner get (View view)

Retrieve the SavedStateRegistryOwner responsible for managing the saved state for the given View. This may be used to save or restore the state associated with the view. The returned SavedStateRegistryOwner is managing all the Views within the Fragment or Activity the given View is added to.

Parameters
view View: View to fetch a SavedStateRegistryOwner for

Returns
SavedStateRegistryOwner The SavedStateRegistryOwner responsible for managing the saved state for the given view and/or some subset of its ancestors