title: How to solve java.lang.RuntimeException: Parcelable encountered IOException writing serializable object
body: <p>In my Android app ,I want to pass my custom object to another activity.I am doing it using intent </p>
  
  <pre><code>Intent i = new Intent(A.this,B.class); 
  i.putExtra ("Object", myObject);
  context.startActivity (i);
  </code></pre>
  
  <p>In calling activity</p>
  
  <pre><code> MyObject myObject = (MyObject) intent.getSerializableExtra ("Object");
  </code></pre>
  
  <p>Also I have implemented Serilizable in my model class.But when I run the app it shows </p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Parcelable encountered IOException writing serializable object</p>
  </blockquote>
  
  <p>The log shows this</p>
  
  <pre><code>java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = com.eventmate2.model.Event)
      at android.os.Parcel.writeSerializable(Parcel.java:1394)
      at android.os.Parcel.writeValue(Parcel.java:1341)
      at android.os.Parcel.writeArrayMapInternal(Parcel.java:644)
      at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313)
      at android.os.Bundle.writeToParcel(Bundle.java:1034)
      at android.os.Parcel.writeBundle(Parcel.java:669)
      at android.content.Intent.writeToParcel(Intent.java:7501)
      at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2479)
      at android.app.Instrumentation.execStartActivity(Instrumentation.java:1496)
      at android.app.Activity.startActivityForResult(Activity.java:3760)
      at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
      at android.app.Activity.startActivityForResult(Activity.java:3721)
      at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
      at android.app.Activity.startActivity(Activity.java:4033)
      at android.app.Activity.startActivity(Activity.java:3999)
      at com.eventmate2.adapter.HomeAdapter$2$1.onMenuItemClick(HomeAdapter.java:188)
      at android.support.v7.widget.PopupMenu$1.onMenuItemSelected(PopupMenu.java:113)
      at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:840)
      at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158)
      at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:991)
      at android.support.v7.view.menu.MenuPopup.onItemClick(MenuPopup.java:128)
      at android.widget.AdapterView.performItemClick(AdapterView.java:305)
      at android.widget.AbsListView.performItemClick(AbsListView.java:1146)
      at android.widget.AbsListView$PerformClick.run(AbsListView.java:3053)
      at android.widget.AbsListView$3.run(AbsListView.java:3865)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5345)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)
   Caused by: java.io.NotSerializableException: com.eventmate2.model.Age
      at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1344)
      at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
      at java.util.ArrayList.writeObject(ArrayList.java:648)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1033)
      at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
      at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
      at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:959)
      at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:360)
      at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1054)
      at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1384)
      at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1651)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1497)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1461)
      at android.os.Parcel.writeSerializable(Parcel.java:1389)
      at android.os.Parcel.writeValue(Parcel.java:1341) 
      at android.os.Parcel.writeArrayMapInternal(Parcel.java:644) 
      at android.os.BaseBundle.writeToParcelInner(BaseBundle.java:1313) 
      at android.os.Bundle.writeToParcel(Bundle.java:1034) 
      at android.os.Parcel.writeBundle(Parcel.java:669) 
      at android.content.Intent.writeToParcel(Intent.java:7501) 
      at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:2479) 
      at android.app.Instrumentation.execStartActivity(Instrumentation.java:1496) 
      at android.app.Activity.startActivityForResult(Activity.java:3760) 
      at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767) 
      at android.app.Activity.startActivityForResult(Activity.java:3721) 
      at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754) 
      at android.app.Activity.startActivity(Activity.java:4033) 
      at android.app.Activity.startActivity(Activity.java:3999) 
      at com.eventmate2.adapter.HomeAdapter$2$1.onMenuItemClick(HomeAdapter.java:188) 
      at android.support.v7.widget.PopupMenu$1.onMenuItemSelected(PopupMenu.java:113) 
      at android.support.v7.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:840) 
      at android.support.v7.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:158) 
      at android.support.v7.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:991) 
      at android.support.v7.view.menu.MenuPopup.onItemClick(MenuPopup.java:128) 
      at android.widget.AdapterView.performItemClick(AdapterView.java:305) 
      at android.widget.AbsListView.performItemClick(AbsListView.java:1146) 
      at android.widget.AbsListView$PerformClick.run(AbsListView.java:3053) 
      at android.widget.AbsListView$3.run(AbsListView.java:3865) 
      at android.os.Handler.handleCallback(Handler.java:739) 
      at android.os.Handler.dispatchMessage(Handler.java:95) 
      at android.os.Looper.loop(Looper.java:135) 
      at android.app.ActivityThread.main(ActivityThread.java:5345) 
      at java.lang.reflect.Method.invoke(Native Method) 
      at java.lang.reflect.Method.invoke(Method.java:372) 
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:947) 
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742) 
  </code></pre>