Android PersistableBundle Introduction.

March 16, 2018 Oclemy Android Bundle 0 minutes, 33 seconds

A PersistableBundle is a type of Bundle that maps Strings to types types that can be saved and later restored.

PersistableBundle definition

PersistableBundle, like Bundle resides in the android.os package:

package android.os;

It was added back in android API level 21.

Persistable class is a final class:

public final class PersistableBundle..{}

so you cannot derive from it.

Like the Bundle class it derives from BaseBundle:

public final class PersistableBundle extends BaseBundle..{}

So it inherits a whole bunch of methods for inserting, retrieving, removing entries into the PersistableBundle.

PersistableBundle implements two interfaces:

Interface Description
Cloneable So that it supports cloning.
Parcelable So that it supports writing to and restoration from a parcel.