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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:54:18+00:00 2026-06-07T21:54:18+00:00

I have this class: public class Hotel implements Parcelable { public Hotel() { super();

  • 0

I have this class:

public class  Hotel implements Parcelable {

public Hotel() {
    super();
}

public Hotel(Parcel in) {
    this.id = in.readString();
    this.hotelFileName = in.readString();
    this.hotelName = in.readString();
    this.rating = in.readString();
    this.cityId = in.readString();
    this.cityFileName = in.readString();
    this.cityName = in.readString();
    this.stateId = in.readString();
    this.stateFileName = in.readString();
    this.stateName = in.readString();
    this.countryCode = in.readString();
    this.countryFileName = in.readString();
    this.countryName = in.readString();
    this.imageId = in.readString();
    this.address = in.readString();
    this.minRate = in.readString();
    this.currencyCode = in.readString();
    Latitude = in.readString();
    Longitude = in.readString();
    NumberOfReviews = in.readString();
    ConsumerRating = in.readString();
    PropertyType = in.readString();
    ChainID = in.readString();
    Facilities = in.readString();
}

public Hotel(String id, String hotelFileName, String hotelName,
        String rating, String cityId, String cityFileName, String cityName,
        String stateId, String stateFileName, String stateName,
        String countryCode, String countryFileName, String countryName,
        String imageId, String address, String minRate,
        String currencyCode, String latitude, String longitude,
        String numberOfReviews, String consumerRating, String propertyType,
        String chainID, String facilities) {
    super();
    this.id = id;
    this.hotelFileName = hotelFileName;
    this.hotelName = hotelName;
    this.rating = rating;
    this.cityId = cityId;
    this.cityFileName = cityFileName;
    this.cityName = cityName;
    this.stateId = stateId;
    this.stateFileName = stateFileName;
    this.stateName = stateName;
    this.countryCode = countryCode;
    this.countryFileName = countryFileName;
    this.countryName = countryName;
    this.imageId = imageId;
    this.address = address;
    this.minRate = minRate;
    this.currencyCode = currencyCode;
    Latitude = latitude;
    Longitude = longitude;
    NumberOfReviews = numberOfReviews;
    ConsumerRating = consumerRating;
    PropertyType = propertyType;
    ChainID = chainID;
    Facilities = facilities;
}

private String id;
private String hotelFileName;
private String hotelName;
private String rating;
private String cityId;
private String cityFileName;
private String cityName;
private String stateId;
private String stateFileName;
private String stateName;
private String countryCode;
private String countryFileName;
private String countryName;
private String imageId;
private String address;
private String minRate;
private String currencyCode;
private String Latitude;
private String Longitude;
private String NumberOfReviews;
private String ConsumerRating;
private String PropertyType;
private String ChainID;
private String Facilities;
private String distance;

@Override
public String toString() {
    return "Hotel [id=" + id + ", hotelFileName=" + hotelFileName
            + ", hotelName=" + hotelName + ", rating=" + rating
            + ", cityId=" + cityId + ", cityFileName=" + cityFileName
            + ", cityName=" + cityName + ", stateId=" + stateId
            + ", stateFileName=" + stateFileName + ", stateName="
            + stateName + ", countryCode=" + countryCode
            + ", countryFileName=" + countryFileName + ", countryName="
            + countryName + ", imageId=" + imageId + ", address=" + address
            + ", minRate=" + minRate + ", currencyCode=" + currencyCode
            + ", Latitude=" + Latitude + ", Longitude=" + Longitude
            + ", NumberOfReviews=" + NumberOfReviews + ", ConsumerRating="
            + ConsumerRating + ", PropertyType=" + PropertyType
            + ", ChainID=" + ChainID + ", Facilities=" + Facilities + "]";
}

public String getId() {
    return id;
}

public String getHotelFileName() {
    return hotelFileName;
}

public void setHotelFileName(String hotelFileName) {
    this.hotelFileName = hotelFileName;
}

public String getHotelName() {
    return hotelName;
}

public void setHotelName(String hotelName) {
    this.hotelName = hotelName;
}

public String getRating() {
    return rating;
}

public String getCityId() {
    return cityId;
}

public void setCityId(String cityId) {
    this.cityId = cityId;
}

public String getCityFileName() {
    return cityFileName;
}

public void setCityFileName(String cityFileName) {
    this.cityFileName = cityFileName;
}

public String getCityName() {
    return cityName;
}

public void setCityName(String cityName) {
    this.cityName = cityName;
}

public String getStateId() {
    return stateId;
}

public void setStateId(String stateId) {
    this.stateId = stateId;
}

public String getStateFileName() {
    return stateFileName;
}

public void setStateFileName(String stateFileName) {
    this.stateFileName = stateFileName;
}

public String getStateName() {
    return stateName;
}

public void setStateName(String stateName) {
    this.stateName = stateName;
}

public String getCountryCode() {
    return countryCode;
}

public void setCountryCode(String countryCode) {
    this.countryCode = countryCode;
}

public String getCountryFileName() {
    return countryFileName;
}

public void setCountryFileName(String countryFileName) {
    this.countryFileName = countryFileName;
}

public String getCountryName() {
    return countryName;
}

public void setCountryName(String countryName) {
    this.countryName = countryName;
}

public String getImageId() {
    return imageId;
}

public void setImageId(String imageId) {
    this.imageId = imageId;
}

public String getAddress() {
    return address;
}

public void setAddress(String address) {
    this.address = address;
}

public String getMinRate() {
    return minRate;
}

public void setMinRate(String minRate) {
    this.minRate = minRate;
}

public String getCurrencyCode() {
    return currencyCode;
}

public void setCurrencyCode(String currencyCode) {
    this.currencyCode = currencyCode;
}

public String getLatitude() {
    return Latitude;
}

public void setLatitude(String latitude) {
    Latitude = latitude;
}

public String getLongitude() {
    return Longitude;
}

public void setLongitude(String longitude) {
    Longitude = longitude;
}

public String getNumberOfReviews() {
    return NumberOfReviews;
}

public void setNumberOfReviews(String numberOfReviews) {
    NumberOfReviews = numberOfReviews;
}

public String getConsumerRating() {
    return ConsumerRating;
}

public void setConsumerRating(String consumerRating) {
    ConsumerRating = consumerRating;
}

public String getPropertyType() {
    return PropertyType;
}

public void setPropertyType(String propertyType) {
    PropertyType = propertyType;
}

public String getChainID() {
    return ChainID;
}

public void setChainID(String chainID) {
    ChainID = chainID;
}

public String getFacilities() {
    return Facilities;
}

public void setFacilities(String facilities) {
    Facilities = facilities;
}

public void setId(String id) {
    this.id = id;
}

public void setRating(String rating) {
    this.rating = rating;
}

public String getDistance() {
    return distance;
}

public void setDistance(String distance) {
    this.distance = distance;
}

@Override
public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(id.isEmpty()?"":id);
    dest.writeString(hotelFileName.isEmpty()?"":hotelFileName);
    dest.writeString(hotelName.isEmpty()?"":hotelName);
    dest.writeString(rating.isEmpty()?"":rating);
    dest.writeString(cityId.isEmpty()?"":cityId);
    dest.writeString(cityFileName.isEmpty()?"":cityFileName);
    dest.writeString(cityName.isEmpty()?"":cityName);
    dest.writeString(stateId.isEmpty()?"":stateId);
    dest.writeString(stateFileName.isEmpty()?"":stateFileName);
    dest.writeString(stateName.isEmpty()?"":stateName);
    dest.writeString(countryCode.isEmpty()?"":countryCode);
    dest.writeString(countryFileName.isEmpty()?"":countryFileName);
    dest.writeString(countryName.isEmpty()?"":countryName);
    dest.writeString(imageId.isEmpty()?"":imageId);
    dest.writeString(address.isEmpty()?"":address);
    dest.writeString(minRate.isEmpty()?"":minRate);
    dest.writeString(currencyCode.isEmpty()?"":currencyCode);
    dest.writeString(Latitude.isEmpty()?"":Latitude);
    dest.writeString(Longitude.isEmpty()?"":Longitude);
    dest.writeString(NumberOfReviews.isEmpty()?"":NumberOfReviews);
    dest.writeString(ConsumerRating.isEmpty()?"":ConsumerRating);
    dest.writeString(PropertyType.isEmpty()?"":PropertyType);
    dest.writeString(ChainID.isEmpty()?"":ChainID);
    dest.writeString(Facilities.isEmpty()?"":Facilities);
    dest.writeString(distance.isEmpty()?"":distance);
}

public static final Parcelable.Creator<Hotel> CREATOR = new Parcelable.Creator<Hotel>() {
    public Hotel createFromParcel(Parcel in) {

        return new Hotel(in);
    }

    public Hotel[] newArray(int size) {

        return new Hotel[size];
    }
};

}

I want to send an arraylist<Hotel> from one intent to another by using i.putExtra("hotels", hotels);

I receive the arraylist<Hotel> by this

ArrayList<Hotel> hotels = (ArrayList<Hotel>) i
                .getSerializableExtra("hotels");

Note that hotels can contain some empty fields.

When I execute, obtain this error:

07-16 18:35:59.779: E/AndroidRuntime(6335): FATAL EXCEPTION: main
07-16 18:35:59.779: E/AndroidRuntime(6335): java.lang.RuntimeException: Unable to start activity ComponentInfo{suptechnique.hotelsdirectory/com.suptech.hotels.map.CarteActivity}: java.lang.RuntimeException: Parcel android.os.Parcel@40511ae8: Unmarshalling unknown type code 3473457 at offset 448
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Looper.loop(Looper.java:123)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.ActivityThread.main(ActivityThread.java:3687)
07-16 18:35:59.779: E/AndroidRuntime(6335): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 18:35:59.779: E/AndroidRuntime(6335): at java.lang.reflect.Method.invoke(Method.java:507)
07-16 18:35:59.779: E/AndroidRuntime(6335): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
07-16 18:35:59.779: E/AndroidRuntime(6335): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
07-16 18:35:59.779: E/AndroidRuntime(6335): at dalvik.system.NativeStart.main(Native Method)
07-16 18:35:59.779: E/AndroidRuntime(6335): Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@40511ae8: Unmarshalling unknown type code 3473457 at offset 448
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Parcel.readValue(Parcel.java:1913)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Parcel.readListInternal(Parcel.java:2092)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Parcel.readArrayList(Parcel.java:1536)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Parcel.readValue(Parcel.java:1867)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Parcel.readMapInternal(Parcel.java:2083)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Bundle.unparcel(Bundle.java:208)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.os.Bundle.getSerializable(Bundle.java:1189)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.content.Intent.getSerializableExtra(Intent.java:3583)
07-16 18:35:59.779: E/AndroidRuntime(6335): at com.suptech.hotels.map.CarteActivity.onCreate(CarteActivity.java:39)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-16 18:35:59.779: E/AndroidRuntime(6335): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
07-16 18:35:59.779: E/AndroidRuntime(6335): … 11 more

  • 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-07T21:54:19+00:00Added an answer on June 7, 2026 at 9:54 pm

    Let your Hotel class implement Serializable instead of Parcelable.

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

Sidebar

Related Questions

I have this class public class wordObject implements java.io.Serializable { String wordName; int occCount;
I have this class: public class CompositeSecurityAuthorizer implements SecurityAuthorizer { @inject @CompositeSecurityAuthorizerAnnot List<SecurityAuthorizer> authorizers;
I have a nested list, something like this: List<Hotel> Hotels; public class Hotel {
I have this class: public class MyClass extends Observable implements Runnable { ... }
I have this class: public class SaveState implements Serializable { private static final long
i have this class public class Image { public string url { get; set;
I have this class: public static class CsvWriter { private static StreamWriter _writer =
I have this class: public MyClass { public void initialize(Collection<String> data) { this.data =
I have this class: public class Source extends Node { protected DistributionSampler delay ;
I have this Class: public class User { public string id{ get; set; }

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.