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

  • SEARCH
  • Home
  • 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 6195535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:29:04+00:00 2026-05-24T03:29:04+00:00

I have a serializable object (ArrayList) within a Parcelable object. I am trying to

  • 0

I have a serializable object (ArrayList) within a Parcelable object. I am trying to read the serializable object, and I can’t figure out how exactly to reconstruct it after reading:

public class WifiAP implements Parcelable {

public String _mac;
public String _mac2;
public String _ssid;
public boolean _dualband;
public int _band;  // kilohertz
public int _band2;
ArrayList<Integer> _rssis;

public Packet _beacon;

public void writeToParcel(Parcel out, int flags) {
    out.writeString(_mac);
    out.writeString(_mac2);
    out.writeString(_ssid);

    if(_dualband)
        out.writeInt(1);
    else
        out.writeInt(0);

    out.writeInt(_band);
    out.writeInt(_band2);
    out.writeSerializable(_rssis);
}

private WifiAP(Parcel in) {
    _mac = in.readString();
    _mac2 = in.readString();
    _ssid = in.readString();

    if(in.readInt()==1)
        _dualband=true;
    else
        _dualband=false;

    _band = in.readInt();
    _band2 = in.readInt();
    _rssis = in.readSerializable(); // help here, this throws an error
}

How do you properly recreate the ArrayList from Parcel.readSerializable?

  • 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-24T03:29:05+00:00Added an answer on May 24, 2026 at 3:29 am

    Try

       _rssis = (ArrayList<Integer>)  in.readSerializable();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I read/write serializable object instances to a RandomAccessFile in Java? I want
I have a Serializable object which is supposed to hold a java.awt.Image as its
I have an object in my Action class which contains an arraylist of objects
I know that you can mark a scala object as @serializable , but I
Let's suppose I have this object: [Serializable] public class MyClass { public int Age
I have a complex, [Serializable] object stored in session. I have Silverlight 3.0 islands
I have an applet trying to send java serialized object to a servlet (hosted
I have an ArrayList of custom, simple Serializable objects I would like to cache
I have been using the Serializable interface to pass an object from one activity
Say I have a couple of basic objects like so: [Serializable] public class Base

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.