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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:28:02+00:00 2026-06-09T14:28:02+00:00

i have a class which implement Serializable. when i’m adding an object from that

  • 0

i have a class which implement Serializable.

when i’m adding an object from that class to the Intent extra and lunch an activity i have no problems.

but when i’m trying to add the object to an Intent lunched by a PedingIntent in a notificatoin bar, i the get the following error:

08-08 18:20:06.186: E/AndroidRuntime(1332): java.lang.RuntimeException: Parcelable encountered IOException writing serializable object 

this is my code:

        this.tickerText = sender.getName() + " Sent you a new message";
        CharSequence contentTitle = "New message from " + sender.getName();       
        CharSequence contentText = "Click to open";
        Intent chat = new Intent(context, Chat.class);      
        chat.putExtra(app.EXTRA_FACEBOOKUSER, sender);
        chat.putExtra(app.EXTRA_RESET_WAINTING_CHAT_MESSAGES, true);
        PendingIntent intent = PendingIntent.getActivity(context, 0, chat, android.content.Intent.FLAG_ACTIVITY_NEW_TASK);      
        this.setLatestEventInfo(context, contentTitle, contentText, intent);

the sender variable class:

import java.io.Serializable;

import android.graphics.drawable.Drawable;


public class FacebookUser implements Serializable{

    /**
     * 
     */

    private static final long serialVersionUID = 1L;

    private String name, gender, status;    
    private int id;
    private double distance, longitude, latitude;;
    private Drawable profilePicture;
    private boolean isFacebookFriend = false;

    public FacebookUser() {

    }

    public FacebookUser(int id, String name)    {
        this.setId(id);
        this.setName(name);     
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public int getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Drawable getProfilePicture() {
        Drawable picture = profilePicture;
        if (picture != null)
            picture = profilePicture.getConstantState().newDrawable();
        return picture;
    }

    public void setProfilePicture(Drawable profilePicture) {
        this.profilePicture = profilePicture;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public double getDistance() {
        return distance;
    }

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

    public boolean isFacebookFriend() {
        return isFacebookFriend;
    }

    public void setFacebookFriend(boolean isFacebookFriend) {
        this.isFacebookFriend = isFacebookFriend;
    }

    public String toString()
    {
        return this.name;
    }

}
  • 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-09T14:28:04+00:00Added an answer on June 9, 2026 at 2:28 pm

    Drawable is not Serializable. Try setting it to transient and to handle the implications of this accordingly in your code. Basically you have to deal with that the Drawable member will be null after de-serialization. You can hook into the serialization process with the readObject and writeObject methods as described in the above link to serialize it yourself.

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

Sidebar

Related Questions

I have a class that instantiates two classes which implement interfaces. I want one
My question is that I have an object class( packet) which contains another object
I have class Money which is an @Embeddable @Embeddable public class Money implements Serializable,
I have a class which must implement the following property public ICollection<IType> Items {
I have a factory class, DocumentLoaderFactory , which simply returns an instance that implements
I have a class with numerous Nullable<T> properties which I want to be serializable
I have class which implements Countable, ArrayAccess, Iterator and Serializable. I have a public
I have a graph object, that I need to serialize. Nomatter which members i
I have a class which implements Serializable. Now I extends this class and I
I have a class TouchPoint which implements Serializable and because it contains Bitmap I

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.