SavedStateRegistryController

public final class SavedStateRegistryController
extends Object

java.lang.Object
   ↳ androidx.savedstate.SavedStateRegistryController


An API for SavedStateRegistryOwner implementations to control SavedStateRegistry.

SavedStateRegistryOwner should call performRestore(Bundle) to restore state of SavedStateRegistry and performSave(Bundle) to gather SavedState from it.

Summary

Public methods

static SavedStateRegistryController create(SavedStateRegistryOwner owner)

Creates a SavedStateRegistryController.

SavedStateRegistry getSavedStateRegistry()

Returns controlled SavedStateRegistry

void performRestore(Bundle savedState)

An interface for an owner of this SavedStateRegistry to restore saved state.

void performSave(Bundle outBundle)

An interface for an owner of this SavedStateRegistry to perform state saving, it will call all registered providers and merge with unconsumed state.

Inherited methods

Public methods

create

public static SavedStateRegistryController create (SavedStateRegistryOwner owner)

Creates a SavedStateRegistryController.

It should be called during construction time of SavedStateRegistryOwner

Parameters
owner SavedStateRegistryOwner

Returns
SavedStateRegistryController

getSavedStateRegistry

public SavedStateRegistry getSavedStateRegistry ()

Returns controlled SavedStateRegistry

Returns
SavedStateRegistry

performRestore

public void performRestore (Bundle savedState)

An interface for an owner of this SavedStateRegistry to restore saved state.

Parameters
savedState Bundle: restored state

performSave

public void performSave (Bundle outBundle)

An interface for an owner of this SavedStateRegistry to perform state saving, it will call all registered providers and merge with unconsumed state.

Parameters
outBundle Bundle: Bundle in which to place a saved state