Compartir a través de


Bundle.GetParcelableArrayList Method

Definition

Overloads

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.

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

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.

[Android.Runtime.Register("getParcelableArrayList", "(Ljava/lang/String;)Ljava/util/ArrayList;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.os.Parcelable" })]
public System.Collections.IList? GetParcelableArrayList (string? key);
[<Android.Runtime.Register("getParcelableArrayList", "(Ljava/lang/String;)Ljava/util/ArrayList;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T extends android.os.Parcelable" })>]
member this.GetParcelableArrayList : string -> System.Collections.IList

Parameters

key
String

a String, or null

Returns

an ArrayList<T> 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.

<b>Note: </b> if the expected value is not a class provided by the Android platform, you must call #setClassLoader(ClassLoader) with the proper ClassLoader first. Otherwise, this method might throw an exception or return null.

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

Java documentation for android.os.Bundle.getParcelableArrayList(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

GetParcelableArrayList(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("getParcelableArrayList", "(Ljava/lang/String;Ljava/lang/Class;)Ljava/util/ArrayList;", "", ApiSince=33)]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public System.Collections.IList? GetParcelableArrayList (string? key, Java.Lang.Class clazz);
[<Android.Runtime.Register("getParcelableArrayList", "(Ljava/lang/String;Ljava/lang/Class;)Ljava/util/ArrayList;", "", ApiSince=33)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
member this.GetParcelableArrayList : string * Java.Lang.Class -> System.Collections.IList

Parameters

key
String

a String, or null

clazz
Class

The type of the items inside the array list. This is only verified when unparceling.

Returns

an ArrayList<T> 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>

<b>Note: </b> if the expected value is not a class provided by the Android platform, you must call #setClassLoader(ClassLoader) with the proper ClassLoader first. Otherwise, this method might throw an exception or return null.

<b>Warning: </b> if the list contains items implementing the Parcelable interface, the class that implements Parcelable has to be the immediately enclosing class of the runtime type of its CREATOR field (that is, Class#getEnclosingClass() has to return the parcelable implementing class), otherwise this method might throw an exception. If the Parcelable class does not enclose the CREATOR, use the deprecated #getParcelableArrayList(String) instead.

Java documentation for android.os.Bundle.getParcelableArrayList(java.lang.String, java.lang.Class<? extends 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