Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7662757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:52:57+00:00 2026-05-31T13:52:57+00:00

I have a Problem with Parcelable Data in an ArrayList sending via two Activities

  • 0

I have a Problem with Parcelable Data in an ArrayList sending via two Activities using Android.Bundle

I have two Activities (A and B).

In Aaaa.class:

ArrayList<Model> mModelList = new ArrayList<Model>
//Fill ArrayList with a few Model-Objects

Bundle mBundle = new Bundle;
Intent mIntent = new Intent(Aaaa.this, Bbbb.class);

mBundle.putParcelableArrayList("models", mModelList);
mIntent.putExtras(mBundle);

startActivity(mIntent);

In Bbbb.class:

Bundle mBundle = getIntent().getExtras();
ArrayList<Model> = mBundle.getParcelableArrayList("models");

The Model.class is implementing Parcelable.

So, the Problem is.
When I fill the ArrayList (in Aaaa.class) and put it to the Bundle, I can see that the Bundle contains the varios Objects from the List.
When I then try to fill the List in Bbbb.class a Exception is Thrown.

 ERROR/AndroidRuntime(11109): FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to start activity ComponentInfo{test/test.activities.Bbbb}: java.lang.RuntimeException: Parcel android.os.Parcel@405585d0: Unmarshalling unknown type code 7667810 at offset 144
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
    at android.app.ActivityThread.access$1500(ActivityThread.java:117)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:3687)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@405585d0: Unmarshalling unknown type code 7667810 at offset 144
    at android.os.Parcel.readValue(Parcel.java:1913)
    at android.os.Parcel.readListInternal(Parcel.java:2092)
    at android.os.Parcel.readArrayList(Parcel.java:1536)
    at android.os.Parcel.readValue(Parcel.java:1867)
    at android.os.Parcel.readMapInternal(Parcel.java:2083)
    at android.os.Bundle.unparcel(Bundle.java:208)
    at android.os.Bundle.getParcelableArrayList(Bundle.java:1144)
    at test.activities.Bbbb.onCreate(Bbbb.java:52)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
    ... 11 more

Line52 is

ArrayList<Model> = mBundle.getParcelableArrayList("models");

I have absolutly no Idea where is the Problem here, the Model.class is working fine with other Bundle – Intents.

Update:

The Model Class as followed.

public class Model implements Parceleble{

  private String name;
  private String address;

  public Model(Parcel parcel){
  }
  public Model(){
  }
  public Model(String name, String address){
    this.name = name;
    this.address = address;
  }

  //Getter and Setter

  //equals, HashCode, toString (autoGenerated from Idea)

  @Override
  public void writeToParcel(Parcel parcel, int i){
    parcel.writeString(name);
    parcel.writeString(address);
  }

  public void readFromParcel(Parcel parcel){
    this.name = parcel.readString();
    this.address = parcel.readString();
  }

  public static Parcelable.Creator<Model> CREATOR = new Parcelable.Creator<Model>(){
  @Override
  public Model createFromParcel(Parcel parcel){
    return new Model(parcel);
  }

  @Override
  public Model[] new Array(int size){
    return new Model[size]
  }
};
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:52:59+00:00Added an answer on May 31, 2026 at 1:52 pm

    Your Parceleble implementation doesn’t look quite correct to me, check out the sample code in API to see what are the required method/constructor that need to be overridden:

    ... ...
    
    // ==================== Parcelable ====================
    public int describeContents() {
      return 0;
    }
    
    public void writeToParcel(Parcel parcel, int flags) {
      parcel.writeString(name);
      parcel.writeString(address);
    }
    
    private Model(Parcel in) {
      name = in.readString();
      address = in.readString();
    }
    
    public static final Parcelable.Creator<Model> CREATOR = new Parcelable.Creator<Model>() {
      public Model createFromParcel(Parcel in) {
        return new Model(in);
      }
    
      public Model[] newArray(int size) {
        return new Model[size];
      }
    };
    
    ... ...
    

    Try this code and see if it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem when I try insert some data to Informix TEXT column via
I have an application which consists of two activities/screens and a java class from
I have a question about parcelable class (android). Until now, I have passed a
I have problem with android 4.0.3. I'm using the method below to get local
I have problem creating new instance of excel 2007 using VBA (from Access 2002).
I have problem with Uploadify: I log in the project using: FormsAuthentication.SetAuthCookie(myName, false); Then,
Have problem while getting data from Memcached on .NET MVC solution. I have this
I have a class 'Product' and i need to pass the arraylist of 'Product'
I have problem with one of my validation regex when using nonstandard utf-8 character.
I have problem with Activities navigation, searching works good. Activities hierarchy looks like that:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.