SavedStateRegistryController



An API for SavedStateRegistryOwner implementations to control SavedStateRegistry.

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

Summary

Public companion functions

SavedStateRegistryController

Creates a SavedStateRegistryController.

Cmn
android

Public functions

Unit

Perform the initial, one time attachment necessary to configure this SavedStateRegistry.

Cmn
android
Unit

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

Cmn
android
Unit

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

Cmn
android

Public properties

SavedStateRegistry

The SavedStateRegistry owned by this controller

Cmn
android

Public companion functions

create

fun create(owner: SavedStateRegistryOwner): SavedStateRegistryController

Creates a SavedStateRegistryController.

It should be called during construction time of SavedStateRegistryOwner

Public functions

performAttach

@MainThread
fun performAttach(): Unit

Perform the initial, one time attachment necessary to configure this SavedStateRegistry. This must be called when the owner's Lifecycle is Lifecycle.State.INITIALIZED and before you call performRestore.

performRestore

@MainThread
fun performRestore(savedState: SavedState?): Unit

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

Parameters
savedState: SavedState?

restored state

performSave

@MainThread
fun performSave(outBundle: SavedState): Unit

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: SavedState

SavedState in which to place a saved state

Public properties

savedStateRegistry

val savedStateRegistrySavedStateRegistry

The SavedStateRegistry owned by this controller