Parcel.ReadSerializable Method

Definition

Overloads

ReadSerializable()

Read and return a new Serializable object from the parcel.

ReadSerializable(ClassLoader, Class)

Same as #readSerializable() but accepts loader and clazz parameters.

ReadSerializable()

Read and return a new Serializable object from the parcel.

[Android.Runtime.Register("readSerializable", "()Ljava/io/Serializable;", "")]
public Java.IO.ISerializable? ReadSerializable ();
[<Android.Runtime.Register("readSerializable", "()Ljava/io/Serializable;", "")>]
member this.ReadSerializable : unit -> Java.IO.ISerializable

Returns

the Serializable object, or null if the Serializable name wasn't found in the parcel.

        Unlike <code data-dev-comment-type="c">#readSerializable(ClassLoader, Class)</code>, it uses the nearest valid class loader
        up the execution stack to instantiate the Serializable object.
Attributes

Remarks

Read and return a new Serializable object from the parcel.

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

Java documentation for android.os.Parcel.readSerializable().

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

ReadSerializable(ClassLoader, Class)

Same as #readSerializable() but accepts loader and clazz parameters.

[Android.Runtime.Register("readSerializable", "(Ljava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Object;", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? ReadSerializable (Java.Lang.ClassLoader? loader, Java.Lang.Class clazz);
[<Android.Runtime.Register("readSerializable", "(Ljava/lang/ClassLoader;Ljava/lang/Class;)Ljava/lang/Object;", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
member this.ReadSerializable : Java.Lang.ClassLoader * Java.Lang.Class -> Java.Lang.Object

Parameters

loader
ClassLoader

A ClassLoader from which to instantiate the Serializable object, or null for the default class loader.

clazz
Class

The type of the object expected.

Returns

Attributes

Remarks

Same as #readSerializable() but accepts loader and clazz parameters.

Java documentation for android.os.Parcel.readSerializable(java.lang.ClassLoader, 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