SavedStateRegistryController
-
Cmn
class 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 |
create(owner: SavedStateRegistryOwner)Creates a |
Cmn
android
|
Public functions |
||
|---|---|---|
Unit |
Perform the initial, one time attachment necessary to configure this |
Cmn
android
|
Unit |
@MainThread |
android
|
Unit |
@MainThreadAn interface for an owner of this |
Cmn
android
|
Unit |
@MainThread |
android
|
Unit |
@MainThreadAn interface for an owner of this |
Cmn
android
|
Public properties |
||
|---|---|---|
SavedStateRegistry |
The |
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 savedStateRegistry: SavedStateRegistry
The SavedStateRegistry owned by this controller