SavedStateProvider


public fun interface SavedStateProvider

Known direct subclasses
SavedStateRegistry.SavedStateProvider

Contributes to the saved state.

SavedStateRegistry

Registry for components that consume and contribute to saved state.


Contributes to the saved state.

Implementations can optionally implement SavedStateRestorer to receive and restore state during the state restoration phase.

Summary

Public methods

abstract @NonNull SavedState

Called to retrieve the state from a component before it is killed so the state can be retrieved later from SavedStateRegistry.consumeRestoredStateForKey.

Public methods

saveState

Added in 1.6.0-alpha02
abstract @NonNull SavedState saveState()

Called to retrieve the state from a component before it is killed so the state can be retrieved later from SavedStateRegistry.consumeRestoredStateForKey.

Returns
@NonNull SavedState

The SavedState containing the saved state.