java.lang.Object | |
↳ | android.os.Bundle |
A mapping from String values to various Parcelable types.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR | |||||||||||
EMPTY |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new, empty Bundle.
| |||||||||||
Constructs a new, empty Bundle that uses a specific ClassLoader for
instantiating Parcelable and Serializable objects.
| |||||||||||
Constructs a new, empty Bundle sized to hold the given number of
elements.
| |||||||||||
Constructs a Bundle containing a copy of the mappings from the given
Bundle.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Removes all elements from the mapping of this Bundle.
| |||||||||||
Clones the current Bundle.
| |||||||||||
Returns true if the given key is contained in the mapping
of this Bundle.
| |||||||||||
Report the nature of this Parcelable's contents
| |||||||||||
Returns the entry with the given key as an object.
| |||||||||||
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.
| |||||||||||
Returns the value associated with the given key, or false if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
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.
| |||||||||||
Returns the value associated with the given key, or (byte) 0 if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
Returns the value associated with the given key, or (char) 0 if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
Return the ClassLoader currently associated with this Bundle.
| |||||||||||
Returns the value associated with the given key, or 0.0 if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
Returns the value associated with the given key, or 0.0f if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or 0 if
no mapping of the desired type exists for the given 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.
| |||||||||||
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.
| |||||||||||
Returns the value associated with the given key, or 0L if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
Returns the value associated with the given key, or (short) 0 if
no mapping of the desired type exists for the given key.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
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.
| |||||||||||
Returns the value associated with the given key, or defaultValue if
no mapping of the desired type exists for the given 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.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
Reports whether the bundle contains any parcelled file descriptors.
| |||||||||||
Returns true if the mapping of this Bundle is empty, false otherwise.
| |||||||||||
Returns a Set containing the Strings used as keys in this Bundle.
| |||||||||||
Inserts all mappings from the given Bundle into this Bundle.
| |||||||||||
Inserts an
IBinder value into the mapping of this Bundle, replacing
any existing value for the given key. | |||||||||||
Inserts a Boolean value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a boolean array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a Bundle value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a byte value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a byte array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a char value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a char array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a CharSequence value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a CharSequence array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts an ArrayList
| |||||||||||
Inserts a double value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a double array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a float value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a float array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts an int value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts an int array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts an ArrayList
| |||||||||||
Inserts a long value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a long array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a Parcelable value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts an array of Parcelable values into the mapping of this Bundle,
replacing any existing value for the given key.
| |||||||||||
Inserts a List of Parcelable values into the mapping of this Bundle,
replacing any existing value for the given key.
| |||||||||||
Inserts a Serializable value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a short value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a short array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a SparceArray of Parcelable values into the mapping of this
Bundle, replacing any existing value for the given key.
| |||||||||||
Inserts a String value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts a String array value into the mapping of this Bundle, replacing
any existing value for the given key.
| |||||||||||
Inserts an ArrayList
| |||||||||||
Reads the Parcel contents into this Bundle, typically in order for
it to be passed through an IBinder connection.
| |||||||||||
Removes any entry with the given key from the mapping of this Bundle.
| |||||||||||
Changes the ClassLoader this Bundle uses when instantiating objects.
| |||||||||||
Returns the number of mappings contained in this Bundle.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Writes the Bundle contents to a Parcel, typically in order for
it to be passed through an IBinder connection.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
Constructs a new, empty Bundle that uses a specific ClassLoader for instantiating Parcelable and Serializable objects.
loader | An explicit ClassLoader to use when instantiating objects inside of the Bundle. |
---|
Constructs a new, empty Bundle sized to hold the given number of elements. The Bundle will grow as needed.
capacity | the initial capacity of the Bundle |
---|
Constructs a Bundle containing a copy of the mappings from the given Bundle.
b | a Bundle to be copied. |
---|
Clones the current Bundle. The internal map is cloned, but the keys and values to which it refers are copied by reference.
Returns true if the given key is contained in the mapping of this Bundle.
key | a String key |
---|
Report the nature of this Parcelable's contents
Returns the entry with the given key as an object.
key | a 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.
key | a String, or null |
---|
Returns the value associated with the given key, or false if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
Returns the value associated with the given key, or (byte) 0 if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
Returns the value associated with the given key, or (char) 0 if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String, or null |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
Return the ClassLoader currently associated with this Bundle.
Returns the value associated with the given key, or 0.0 if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
Returns the value associated with the given key, or 0.0f if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
Returns the value associated with the given key, or 0 if no mapping of the desired type exists for the given key.
key | a String |
---|
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
Returns the value associated with the given key, or 0L if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
Returns the value associated with the given key, or (short) 0 if no mapping of the desired type exists for the given key.
key | a String |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.
key | a String, or null |
---|---|
defaultValue | Value to return if key does not exist |
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
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.
key | a String, or null |
---|
Reports whether the bundle contains any parcelled file descriptors.
Returns true if the mapping of this Bundle is empty, false otherwise.
Returns a Set containing the Strings used as keys in this Bundle.
Inserts all mappings from the given Bundle into this Bundle.
map | a Bundle |
---|
Inserts an IBinder
value into the mapping of this Bundle, replacing
any existing value for the given key. Either key or value may be null.
You should be very careful when using this function. In many places where Bundles are used (such as inside of Intent objects), the Bundle can live longer inside of another process than the process that had originally created it. In that case, the IBinder you supply here will become invalid when your process goes away, and no longer usable, even if a new process is created for you later on.
key | a String, or null |
---|---|
value | an IBinder object, or null |
Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a Boolean, or null |
Inserts a boolean array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a boolean array object, or null |
Inserts a Bundle value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a Bundle object, or null |
Inserts a byte value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | a byte |
Inserts a byte array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a byte array object, or null |
Inserts a char value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | a char, or null |
Inserts a char array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a char array object, or null |
Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a CharSequence, or null |
Inserts a CharSequence array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a CharSequence array object, or null |
Inserts an ArrayList
key | a String, or null |
---|---|
value | an ArrayList |
Inserts a double value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | a double |
Inserts a double array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a double array object, or null |
Inserts a float value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | a float |
Inserts a float array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a float array object, or null |
Inserts an int value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | an int, or null |
Inserts an int array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | an int array object, or null |
Inserts an ArrayList
key | a String, or null |
---|---|
value | an ArrayList |
Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | a long |
Inserts a long array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a long array object, or null |
Inserts a Parcelable value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a Parcelable object, or null |
Inserts an array of Parcelable values into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | an array of Parcelable objects, or null |
Inserts a List of Parcelable values into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | an ArrayList of Parcelable objects, or null |
Inserts a Serializable value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a Serializable object, or null |
Inserts a short value into the mapping of this Bundle, replacing any existing value for the given key.
key | a String, or null |
---|---|
value | a short |
Inserts a short array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a short array object, or null |
Inserts a SparceArray of Parcelable values into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a SparseArray of Parcelable objects, or null |
Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a String, or null |
Inserts a String array value into the mapping of this Bundle, replacing any existing value for the given key. Either key or value may be null.
key | a String, or null |
---|---|
value | a String array object, or null |
Inserts an ArrayList
key | a String, or null |
---|---|
value | an ArrayList |
Reads the Parcel contents into this Bundle, typically in order for it to be passed through an IBinder connection.
parcel | The parcel to overwrite this bundle from. |
---|
Removes any entry with the given key from the mapping of this Bundle.
key | a String key |
---|
Changes the ClassLoader this Bundle uses when instantiating objects.
loader | An explicit ClassLoader to use when instantiating objects inside of the Bundle. |
---|
Returns the number of mappings contained in this Bundle.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.
parcel | The parcel to copy this bundle to. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|