Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

ParcelUtils

open class ParcelUtils
kotlin.Any
   ↳ androidx.versionedparcelable.ParcelUtils

Utilities for managing VersionedParcelables.

Summary

Public methods

open static T?
getVersionedParcelable(@NonNull bundle: Bundle, @NonNull key: String)

Get a VersionedParcelable from a Bundle.

open static MutableList<T>?

Get a list of VersionedParcelable from a Bundle.

open static Unit
putVersionedParcelable(@NonNull b: Bundle, @NonNull key: String, @Nullable obj: VersionedParcelable?)

Add a VersionedParcelable to an existing Bundle.

open static Unit
putVersionedParcelableList(@NonNull b: Bundle, @NonNull key: String, @NonNull list: MutableList<out VersionedParcelable!>)

Add a list of VersionedParcelable to an existing Bundle.

Public methods

getVersionedParcelable

@Nullable open static fun <T : VersionedParcelable!> getVersionedParcelable(@NonNull bundle: Bundle, @NonNull key: String): T?

Get a VersionedParcelable from a Bundle. Returns null if the bundle isn't present or ClassLoader issues occur.

getVersionedParcelableList

@Nullable open static fun <T : VersionedParcelable!> getVersionedParcelableList(bundle: Bundle!, key: String!): MutableList<T>?

Get a list of VersionedParcelable from a Bundle. Returns null if the bundle isn't present or ClassLoader issues occur.

putVersionedParcelable

open static fun putVersionedParcelable(@NonNull b: Bundle, @NonNull key: String, @Nullable obj: VersionedParcelable?): Unit

Add a VersionedParcelable to an existing Bundle.

putVersionedParcelableList

open static fun putVersionedParcelableList(@NonNull b: Bundle, @NonNull key: String, @NonNull list: MutableList<out VersionedParcelable!>): Unit

Add a list of VersionedParcelable to an existing Bundle.