ParcelableArraySerializer


public final class ParcelableArraySerializer implements KSerializer


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

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

import androidx.savedstate.serialization.serializers.ParcelableArraySerializer

@Serializable
class MyModel(
    @Serializable(with = ParcelableArraySerializer::class)
    val parcelableArray: Array<android.os.Parcelable>
)

Summary

Public constructors

Public methods

@NonNull Parcelable[]
@NonNull SerialDescriptor
void
serialize(@NonNull Encoder encoder, @NonNull Parcelable[] value)

Public constructors

ParcelableArraySerializer

Added in 1.3.0-alpha06
public ParcelableArraySerializer()

Public methods

deserialize

Added in 1.3.0-alpha06
public @NonNull Parcelable[] deserialize(@NonNull Decoder decoder)

getDescriptor

Added in 1.3.0-alpha06
public @NonNull SerialDescriptor getDescriptor()

serialize

Added in 1.3.0-alpha06
public void serialize(@NonNull Encoder encoder, @NonNull Parcelable[] value)