Register now for Android Dev Summit 2019!

SavedStateProvider

interface SavedStateProvider
androidx.savedstate.SavedStateRegistry.SavedStateProvider

This interface marks a component that contributes to saved state.

Summary

Public methods

abstract Bundle

Called to retrieve a state from a component before being killed so later the state can be received from consumeRestoredStateForKey(String)

Public methods

saveState

@NonNull abstract fun saveState(): Bundle

Called to retrieve a state from a component before being killed so later the state can be received from consumeRestoredStateForKey(String)

Return
Bundle: S with your saved state.