Stay organized with collections
Save and categorize content based on your preferences.
Parcelable.ClassLoaderCreator
public
static
interface
Parcelable.ClassLoaderCreator
implements
Creator<T>
android.os.Parcelable.ClassLoaderCreator<T>
|
Specialization of Creator
that allows you to receive the
ClassLoader the object is being created in.
Summary
Public methods
createFromParcel
public abstract T createFromParcel (Parcel source,
ClassLoader loader)
Create a new instance of the Parcelable class, instantiating it
from the given Parcel whose data had previously been written by
Parcelable.writeToParcel()
and
using the given ClassLoader.
Parameters |
source |
Parcel : The Parcel to read the object's data from. |
loader |
ClassLoader : The ClassLoader that this object is being created in. |
Returns |
T |
Returns a new instance of the Parcelable class. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Parcelable.ClassLoaderCreator\n\nAdded in [API level 13](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nParcelable.ClassLoaderCreator\n=============================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/os/Parcelable.ClassLoaderCreator \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nParcelable.ClassLoaderCreator\n`\n\n\n`\n\n\nimplements\n\n`[Creator](/reference/android/os/Parcelable.Creator)`\u003cT\u003e\n\n\n`\n\n|-----------------------------------------------|\n| android.os.Parcelable.ClassLoaderCreator\\\u003cT\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSpecialization of [Creator](/reference/android/os/Parcelable.Creator) that allows you to receive the\nClassLoader the object is being created in.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract T` | ` `[createFromParcel](/reference/android/os/Parcelable.ClassLoaderCreator#createFromParcel(android.os.Parcel,%20java.lang.ClassLoader))`(`[Parcel](/reference/android/os/Parcel)` source, `[ClassLoader](/reference/java/lang/ClassLoader)` loader) ` Create a new instance of the Parcelable class, instantiating it from the given Parcel whose data had previously been written by [Parcelable.writeToParcel()](/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)) and using the given ClassLoader. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.os.Parcelable.Creator](/reference/android/os/Parcelable.Creator)` ` |-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract T` | ` `[createFromParcel](/reference/android/os/Parcelable.Creator#createFromParcel(android.os.Parcel))`(`[Parcel](/reference/android/os/Parcel)` source) ` Create a new instance of the Parcelable class, instantiating it from the given Parcel whose data had previously been written by [Parcelable.writeToParcel()](/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)). | | ` abstract T[]` | ` `[newArray](/reference/android/os/Parcelable.Creator#newArray(int))`(int size) ` Create a new array of the Parcelable class. | ||\n\nPublic methods\n--------------\n\n### createFromParcel\n\nAdded in [API level 13](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract T createFromParcel (Parcel source, \n ClassLoader loader)\n```\n\nCreate a new instance of the Parcelable class, instantiating it\nfrom the given Parcel whose data had previously been written by\n[Parcelable.writeToParcel()](/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)) and\nusing the given ClassLoader.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------|\n| `source` | `Parcel`: The Parcel to read the object's data from. \u003cbr /\u003e |\n| `loader` | `ClassLoader`: The ClassLoader that this object is being created in. \u003cbr /\u003e |\n\n| Returns ||\n|-----|--------------------------------------------------------|\n| `T` | Returns a new instance of the Parcelable class. \u003cbr /\u003e |"]]