Bundle Bundle Class

Definition

A mapping from String values to various Parcelable types.

[Android.Runtime.Register("android/os/Bundle", ApiSince=1, DoNotGenerateAcw=true)]
public sealed class Bundle : Android.OS.BaseBundle, Android.OS.IParcelable, IDisposable, Java.Lang.ICloneable
type Bundle = class
    inherit BaseBundle
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface ICloneable
Inheritance
Attributes
Implements

Remarks

Android platform documentation

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Bundle() Bundle()

Constructs a new, empty Bundle.

Bundle(Bundle) Bundle(Bundle)

Constructs a Bundle containing a copy of the mappings from the given Bundle.

Bundle(ClassLoader) Bundle(ClassLoader)

Constructs a new, empty Bundle that uses a specific ClassLoader for instantiating Parcelable and Serializable objects.

Bundle(Int32) Bundle(Int32)

Constructs a new, empty Bundle sized to hold the given number of elements.

Bundle(PersistableBundle) Bundle(PersistableBundle)

Constructs a Bundle containing a copy of the mappings from the given PersistableBundle.

Properties

Class Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
ClassLoader ClassLoader

Return the ClassLoader currently associated with this Bundle.

Creator Creator
Empty Empty
Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasFileDescriptors HasFileDescriptors

Reports whether the bundle contains any parcelled file descriptors.

IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsEmpty IsEmpty

Returns true if the mapping of this Bundle is empty, false otherwise.

JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
PeerReference PeerReference Inherited from Object
ThresholdClass ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from BaseBundle)
ThresholdType ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from BaseBundle)

Methods

Clear() Clear()

Removes all elements from the mapping of this Bundle.

Clone() Clone()

Clones the current Bundle.

ContainsKey(String) ContainsKey(String)

Returns true if the given key is contained in the mapping of this Bundle.

DeepCopy() DeepCopy()
DescribeContents() DescribeContents()

Report the nature of this Parcelable's contents

Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Equals(Object) Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
Get(String) Get(String)

Returns the entry with the given key as an object.

GetBinder(String) GetBinder(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.

GetBoolean(String) GetBoolean(String)

Returns the value associated with the given key, or false if no mapping of the desired type exists for the given key.

GetBoolean(String, Boolean) GetBoolean(String, Boolean)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetBooleanArray(String) GetBooleanArray(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.

GetBundle(String) GetBundle(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.

GetByte(String) GetByte(String)

Returns the value associated with the given key, or (byte) 0 if no mapping of the desired type exists for the given key.

GetByte(String, SByte) GetByte(String, SByte)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetByteArray(String) GetByteArray(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.

GetChar(String) GetChar(String)

Returns the value associated with the given key, or (char) 0 if no mapping of the desired type exists for the given key.

GetChar(String, Char) GetChar(String, Char)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetCharArray(String) GetCharArray(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.

GetCharSequence(String) GetCharSequence(String)
GetCharSequence(String, String) GetCharSequence(String, String)
GetCharSequenceArray(String) GetCharSequenceArray(String)
GetCharSequenceArrayFormatted(String) GetCharSequenceArrayFormatted(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.

GetCharSequenceArrayList(String) GetCharSequenceArrayList(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.

GetCharSequenceFormatted(String) GetCharSequenceFormatted(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.

GetCharSequenceFormatted(String, ICharSequence) GetCharSequenceFormatted(String, ICharSequence)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key or if a null value is explicitly associatd with the given key.

GetDouble(String) GetDouble(String)

Returns the value associated with the given key, or 0.0 if no mapping of the desired type exists for the given key.

GetDouble(String, Double) GetDouble(String, Double)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetDoubleArray(String) GetDoubleArray(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.

GetFloat(String) GetFloat(String)

Returns the value associated with the given key, or 0.0f if no mapping of the desired type exists for the given key.

GetFloat(String, Single) GetFloat(String, Single)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetFloatArray(String) GetFloatArray(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.

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetInt(String) GetInt(String)

Returns the value associated with the given key, or 0 if no mapping of the desired type exists for the given key.

GetInt(String, Int32) GetInt(String, Int32)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetIntArray(String) GetIntArray(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.

GetIntegerArrayList(String) GetIntegerArrayList(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.

GetLong(String) GetLong(String)

Returns the value associated with the given key, or 0L if no mapping of the desired type exists for the given key.

GetLong(String, Int64) GetLong(String, Int64)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetLongArray(String) GetLongArray(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.

GetParcelable(String) GetParcelable(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.

GetParcelableArray(String) GetParcelableArray(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.

GetParcelableArrayList(String) GetParcelableArrayList(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.

GetSerializable(String) GetSerializable(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.

GetShort(String) GetShort(String)

Returns the value associated with the given key, or (short) 0 if no mapping of the desired type exists for the given key.

GetShort(String, Int16) GetShort(String, Int16)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetShortArray(String) GetShortArray(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.

GetSize(String) GetSize(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.

GetSizeF(String) GetSizeF(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.

GetSparseParcelableArray(String) GetSparseParcelableArray(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.

GetString(String) GetString(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.

GetString(String, String) GetString(String, String)

Returns the value associated with the given key, or defaultValue if no mapping of the desired type exists for the given key.

GetStringArray(String) GetStringArray(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.

GetStringArrayList(String) GetStringArrayList(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.

JavaFinalize() JavaFinalize()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
KeySet() KeySet()

Returns a Set containing the Strings used as keys in this Bundle.

Notify() Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll() NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
PutAll(Bundle) PutAll(Bundle)

Inserts all mappings from the given Bundle into this Bundle.

PutAll(PersistableBundle) PutAll(PersistableBundle)

Inserts all mappings from the given PersistableBundle into this BaseBundle.

(Inherited from BaseBundle)
PutBinder(String, IBinder) PutBinder(String, IBinder)

Inserts an BinderConsts value into the mapping of this Bundle, replacing any existing value for the given key.

PutBoolean(String, Boolean) PutBoolean(String, Boolean)

Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key.

PutBooleanArray(String, Boolean[]) PutBooleanArray(String, Boolean[])

Inserts a boolean array value into the mapping of this Bundle, replacing any existing value for the given key.

PutBundle(String, Bundle) PutBundle(String, Bundle)

Inserts a Bundle value into the mapping of this Bundle, replacing any existing value for the given key.

PutByte(String, SByte) PutByte(String, SByte)

Inserts a byte value into the mapping of this Bundle, replacing any existing value for the given key.

PutByteArray(String, Byte[]) PutByteArray(String, Byte[])

Inserts a byte array value into the mapping of this Bundle, replacing any existing value for the given key.

PutChar(String, Char) PutChar(String, Char)

Inserts a char value into the mapping of this Bundle, replacing any existing value for the given key.

PutCharArray(String, Char[]) PutCharArray(String, Char[])

Inserts a char array value into the mapping of this Bundle, replacing any existing value for the given key.

PutCharSequence(String, ICharSequence) PutCharSequence(String, ICharSequence)

Inserts a CharSequence value into the mapping of this Bundle, replacing any existing value for the given key.

PutCharSequence(String, String) PutCharSequence(String, String)
PutCharSequenceArray(String, ICharSequence[]) PutCharSequenceArray(String, ICharSequence[])

Inserts a CharSequence array value into the mapping of this Bundle, replacing any existing value for the given key.

PutCharSequenceArray(String, String[]) PutCharSequenceArray(String, String[])
PutCharSequenceArrayList(String, IList<ICharSequence>) PutCharSequenceArrayList(String, IList<ICharSequence>)
PutDouble(String, Double) PutDouble(String, Double)

Inserts a double value into the mapping of this Bundle, replacing any existing value for the given key.

PutDoubleArray(String, Double[]) PutDoubleArray(String, Double[])

Inserts a double array value into the mapping of this Bundle, replacing any existing value for the given key.

PutFloat(String, Single) PutFloat(String, Single)

Inserts a float value into the mapping of this Bundle, replacing any existing value for the given key.

PutFloatArray(String, Single[]) PutFloatArray(String, Single[])

Inserts a float array value into the mapping of this Bundle, replacing any existing value for the given key.

PutInt(String, Int32) PutInt(String, Int32)

Inserts an int value into the mapping of this Bundle, replacing any existing value for the given key.

PutIntArray(String, Int32[]) PutIntArray(String, Int32[])

Inserts an int array value into the mapping of this Bundle, replacing any existing value for the given key.

PutIntegerArrayList(String, IList<Integer>) PutIntegerArrayList(String, IList<Integer>)
PutLong(String, Int64) PutLong(String, Int64)

Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key.

PutLongArray(String, Int64[]) PutLongArray(String, Int64[])

Inserts a long array value into the mapping of this Bundle, replacing any existing value for the given key.

PutParcelable(String, IParcelable) PutParcelable(String, IParcelable)

Inserts a Parcelable value into the mapping of this Bundle, replacing any existing value for the given key.

PutParcelableArray(String, IParcelable[]) PutParcelableArray(String, IParcelable[])

Inserts an array of Parcelable values into the mapping of this Bundle, replacing any existing value for the given key.

PutParcelableArrayList(String, IList<IParcelable>) PutParcelableArrayList(String, IList<IParcelable>)
PutSerializable(String, ISerializable) PutSerializable(String, ISerializable)

Inserts a Serializable value into the mapping of this Bundle, replacing any existing value for the given key.

PutShort(String, Int16) PutShort(String, Int16)

Inserts a short value into the mapping of this Bundle, replacing any existing value for the given key.

PutShortArray(String, Int16[]) PutShortArray(String, Int16[])

Inserts a short array value into the mapping of this Bundle, replacing any existing value for the given key.

PutSize(String, Size) PutSize(String, Size)

Inserts a Size value into the mapping of this Bundle, replacing any existing value for the given key.

PutSizeF(String, SizeF) PutSizeF(String, SizeF)

Inserts a SizeF value into the mapping of this Bundle, replacing any existing value for the given key.

PutSparseParcelableArray(String, SparseArray) PutSparseParcelableArray(String, SparseArray)
PutString(String, String) PutString(String, String)

Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key.

PutStringArray(String, String[]) PutStringArray(String, String[])

Inserts a String array value into the mapping of this Bundle, replacing any existing value for the given key.

PutStringArrayList(String, IList<String>) PutStringArrayList(String, IList<String>)
ReadFromParcel(Parcel) ReadFromParcel(Parcel)

Reads the Parcel contents into this Bundle, typically in order for it to be passed through an IBinder connection.

Remove(String) Remove(String)

Removes any entry with the given key from the mapping of this Bundle.

SetClassLoader(ClassLoader) SetClassLoader(ClassLoader)

Changes the ClassLoader this Bundle uses when instantiating objects.

SetHandle(IntPtr, JniHandleOwnership) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
Size() Size()

Returns the number of mappings contained in this Bundle.

ToArray<T>() ToArray<T>() Inherited from Object
ToString() ToString()

Returns a string containing a concise, human-readable description of this object.

(Inherited from Object)
UnregisterFromRuntime() UnregisterFromRuntime() Inherited from Object
Wait() Wait()

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64) Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32) Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags) WriteToParcel(Parcel, ParcelableWriteFlags)

Writes the Bundle contents to a Parcel, typically in order for it to be passed through an IBinder connection.

Explicit Interface Implementations

IJavaObjectEx.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to