PersistableBundle
public
final
class
PersistableBundle
extends BaseBundle
implements
Cloneable,
Parcelable
| java.lang.Object | ||
| ↳ | android.os.BaseBundle | |
| ↳ | android.os.PersistableBundle | |
A mapping from String keys to values of various types. The set of types supported by this class is purposefully restricted to simple objects that can safely be persisted to and restored from disk.
See also:
Summary
Inherited constants |
|---|
android.os.Parcelable
|
Fields | |
|---|---|
public
static
final
Creator<PersistableBundle> |
CREATOR
|
public
static
final
PersistableBundle |
EMPTY
|
Public constructors | |
|---|---|
PersistableBundle()
Constructs a new, empty PersistableBundle. |
|
PersistableBundle(int capacity)
Constructs a new, empty PersistableBundle sized to hold the given number of elements. |
|
PersistableBundle(PersistableBundle b)
Constructs a PersistableBundle containing a copy of the mappings from the given PersistableBundle. |
|
Public methods | |
|---|---|
Object
|
clone()
Clones the current PersistableBundle. |
PersistableBundle
|
deepCopy()
Make a deep copy of the given bundle. |
int
|
describeContents()
Report the nature of this Parcelable's contents |
PersistableBundle
|
getPersistableBundle(String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key. |
void
|
putPersistableBundle(String key, PersistableBundle value)
Inserts a PersistableBundle value into the mapping of this Bundle, replacing any existing value for the given key. |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel parcel, int flags)
Writes the PersistableBundle contents to a Parcel, typically in order for it to be passed through an IBinder connection. |
Inherited methods | |
|---|---|
android.os.BaseBundle
| |
java.lang.Object
| |
android.os.Parcelable
| |
Fields
Public constructors
PersistableBundle
PersistableBundle ()
Constructs a new, empty PersistableBundle.
PersistableBundle
PersistableBundle (int capacity)
Constructs a new, empty PersistableBundle sized to hold the given number of elements. The PersistableBundle will grow as needed.
| Parameters | |
|---|---|
capacity |
int: the initial capacity of the PersistableBundle
|
PersistableBundle
PersistableBundle (PersistableBundle b)
Constructs a PersistableBundle containing a copy of the mappings from the given
PersistableBundle. Does only a shallow copy of the original PersistableBundle -- see
deepCopy() if that is not what you want.
| Parameters | |
|---|---|
b |
PersistableBundle: a PersistableBundle to be copied. |
See also:
Public methods
clone
Object clone ()
Clones the current PersistableBundle. The internal map is cloned, but the keys and values to which it refers are copied by reference.
| Returns | |
|---|---|
Object |
a clone of this instance. |
deepCopy
PersistableBundle deepCopy ()
Make a deep copy of the given bundle. Traverses into inner containers and copies
them as well, so they are not shared across bundles. Will traverse in to
Bundle, PersistableBundle, ArrayList, and all types of
primitive arrays. Other types of objects (such as Parcelable or Serializable)
are referenced as-is and not copied in any way.
| Returns | |
|---|---|
PersistableBundle |
|
describeContents
int describeContents ()
Report the nature of this Parcelable's contents
| Returns | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
getPersistableBundle
PersistableBundle getPersistableBundle (String key)
Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.
| Parameters | |
|---|---|
key |
String: a String, or nullThis value may be |
| Returns | |
|---|---|
PersistableBundle |
a Bundle value, or null
This value may be |
putPersistableBundle
void putPersistableBundle (String key, PersistableBundle value)
Inserts a PersistableBundle value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
| Parameters | |
|---|---|
key |
String: a String, or nullThis value may be |
value |
PersistableBundle: a Bundle object, or null
This value may be |
toString
String toString ()
Returns a string representation of the object. In general, the
toString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
| Returns | |
|---|---|
String |
a string representation of the object. |
writeToParcel
void writeToParcel (Parcel parcel, int flags)
Writes the PersistableBundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
| Parameters | |
|---|---|
parcel |
Parcel: The parcel to copy this bundle to.
|
flags |
int: Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
|
Interfaces
Classes
- AsyncTask
- BaseBundle
- BatteryManager
- Binder
- Build
- Build.VERSION
- Build.VERSION_CODES
- Bundle
- CancellationSignal
- ConditionVariable
- CountDownTimer
- CpuUsageInfo
- Debug
- Debug.InstructionCount
- Debug.MemoryInfo
- DropBoxManager
- DropBoxManager.Entry
- Environment
- FileObserver
- Handler
- HandlerThread
- HardwarePropertiesManager
- LocaleList
- Looper
- MemoryFile
- Message
- MessageQueue
- Messenger
- Parcel
- ParcelFileDescriptor
- ParcelFileDescriptor.AutoCloseInputStream
- ParcelFileDescriptor.AutoCloseOutputStream
- ParcelUuid
- PatternMatcher
- PersistableBundle
- PowerManager
- PowerManager.WakeLock
- Process
- ProxyFileDescriptorCallback
- RecoverySystem
- RemoteCallbackList
- ResultReceiver
- StatFs
- StrictMode
- StrictMode.ThreadPolicy
- StrictMode.ThreadPolicy.Builder
- StrictMode.VmPolicy
- StrictMode.VmPolicy.Builder
- SystemClock
- TestLooperManager
- TokenWatcher
- Trace
- UserHandle
- UserManager
- VibrationEffect
- Vibrator
- WorkSource
Enums
Exceptions