title: android Serializable
body: <p>i have a class which implement Serializable.</p>
  
  <p>when i'm adding an object from that class to the Intent extra and lunch an activity i have no problems.</p>
  
  <p>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:</p>
  
  <pre><code>08-08 18:20:06.186: E/AndroidRuntime(1332): java.lang.RuntimeException: Parcelable encountered IOException writing serializable object 
  </code></pre>
  
  <p>this is my code:</p>
  
  <pre><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);
  </code></pre>
  
  <p>the sender variable class:</p>
  
  <pre><code>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;
      }
  
  }
  </code></pre>