SavedStateSerializer



A serializer for SavedState. This serializer uses SavedState's API to save/load a SavedState.

Note that this serializer should be used with androidx.savedstate.serialization.SavedStateEncoder or androidx.savedstate.serialization.SavedStateDecoder only. Using it with other Encoders/Decoders may throw IllegalArgumentException.

import androidx.savedstate.serialization.serializers.SavedStateSerializer

@Serializable
data class MyModel(
    @Serializable(with = SavedStateSerializer::class) val savedState: SavedState
)

Summary

Public constructors

Cmn

Public functions

open SavedState
Cmn
open Unit
Cmn

Public properties

open <Error class: unknown class>
Cmn

Public constructors

SavedStateSerializer

SavedStateSerializer()

Public functions

deserialize

open fun deserialize(decoder: <Error class: unknown class>): SavedState

serialize

open fun serialize(encoder: <Error class: unknown class>, value: SavedState): Unit

Public properties

descriptor

open val descriptor<Error class: unknown class>