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 7789903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:26:01+00:00 2026-06-01T21:26:01+00:00

I had to pass a dataobject from one activity to another. The best way

  • 0

I had to pass a dataobject from one activity to another. The best way to do this is uing Parcelable.
The dataobject had some fields with setter and getter methods. After setting some fields and passing the object to another activity, wha tI observed is that the field values got interchanged to other field values.
The order of fields for writing to parcel and reading from parcel is the same.

public void writeToParcel(Parcel out, int flags) {
    out.writeInt(id);
    out.writeString(appNo);
    out.writeString(this.policyNo);
    out.writeInt((int)this.AppRcptDt.getTime());
    out.writeString(this.currentStatus);
    out.writeString(this.productCd);
    out.writeDouble(this.sumAssured);
    out.writeDouble(this.modalPremium);
    out.writeDouble(this.annualPremium);
    out.writeString(this.paymentMode);
    out.writeString(this.branchCd);
    out.writeString(this.branchName);
    out.writeString(this.insuredName);
    out.writeString(this.auraStatus);
    out.writeString(this.ownerName);
    out.writeString(this.agentCd);
    out.writeString(this.billingMode);
}

private ApplicationTrackerDO(Parcel in) {
    id=in.readInt();
    this.appNo = in.readString();
    this.policyNo = in.readString();
    this.AppRcptDt = new Date(in.readLong());
    this.currentStatus = in.readString();
    this.productCd = in.readString();
    this.sumAssured = in.readDouble();
    this.modalPremium = in.readDouble();
    this.annualPremium = in.readDouble();
    this.paymentMode = in.readString();
    this.branchCd = in.readString();
    this.branchName = in.readString();
    this.insuredName = in.readString();
    this.auraStatus = in.readString();
    this.ownerName = in.readString();
    this.agentCd = in.readString();
    this.billingMode = in.readString();
}

difference in field values

  • 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-06-01T21:26:03+00:00Added an answer on June 1, 2026 at 9:26 pm

    It is not the order but the data type that is not the same, from the first 4 lines you write int, string, string, int then you read int, string, string, long. I didn’t check any further, you must match both order and datatype of read and write operations.

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

Sidebar

Related Questions

i've often had this issue where i do not really understand how to pass
Had an interesting discussion with some colleagues about the best scheduling strategies for realtime
Had this working; at one stage. The problem is the following text is now
I pass text strings from a configuration file into my Flex app, one of
I had found some info that Buying music from the iTunes Store is limited
Following this question - Pass Method as Parameter using C# and some of my
I'm calling an event handler from another one: private void launchApplicationToolStripMenuItem_Click(object sender, EventArgs e)
I had Repeater which bind method this method retrieve data from data base by
i had a question in my program. When I pass the 3D int array
Had a coworker ask me this, and in my brain befuddled state I didn't

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.