Share via


Bundle.GetSerializable Method

Definition

Overloads

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.

GetSerializable(String, Class)

Returns the value associated with the given key, or null if: <ul> <li>No mapping of the desired type exists for the given key.

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.

[Android.Runtime.Register("getSerializable", "(Ljava/lang/String;)Ljava/io/Serializable;", "")]
public Java.IO.ISerializable? GetSerializable (string? key);
[<Android.Runtime.Register("getSerializable", "(Ljava/lang/String;)Ljava/io/Serializable;", "")>]
member this.GetSerializable : string -> Java.IO.ISerializable

Parameters

key
String

a String, or null

Returns

a Serializable value, or null

Attributes

Remarks

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.

This member is deprecated. Use the type-safer #getSerializable(String, Class) starting from Android Build.VERSION_CODES#TIRAMISU.

Java documentation for android.os.Bundle.getSerializable(java.lang.String).

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.

Applies to

GetSerializable(String, Class)

Returns the value associated with the given key, or null if: <ul> <li>No mapping of the desired type exists for the given key.

[Android.Runtime.Register("getSerializable", "(Ljava/lang/String;Ljava/lang/Class;)Ljava/io/Serializable;", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.io.Serializable" })]
public Java.Lang.Object? GetSerializable (string? key, Java.Lang.Class clazz);
[<Android.Runtime.Register("getSerializable", "(Ljava/lang/String;Ljava/lang/Class;)Ljava/io/Serializable;", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends java.io.Serializable" })>]
member this.GetSerializable : string * Java.Lang.Class -> Java.Lang.Object

Parameters

key
String

a String, or null

clazz
Class

The expected class of the returned type

Returns

a Serializable value, or null

Attributes

Remarks

Returns the value associated with the given key, or null if: <ul> <li>No mapping of the desired type exists for the given key. <li>A null value is explicitly associated with the key. <li>The object is not of type clazz. </ul>

Java documentation for android.os.Bundle.getSerializable(java.lang.String, java.lang.Class<T>).

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.

Applies to