title: store intent in bundle on onSaveInstanceState / Class not found when unmarshalling
body: <p>I'm storing intent in bundle on onSaveInstanceState.
  But I have a problem while getParcelable on onCreate.
  I got ClassNotFoundException.</p>
  
  <p>If I try to putParcelable with MyParcel alone, I do not get Exception, but If I put it in intent and pass it through bundle, and get from bundle with getParcelable? I get the Exception.</p>
  
  <p>Please, Help me. please...</p>
  
  <p>Here's my code.</p>
  
  <pre><code>@Override
  protected void onSaveInstanceState(Bundle outState) {
      Intent intent = new Intent(getIntent());
      outState.putParcelable("SAVED_INTENT", intent);
      super.onSaveInstanceState(outState);
  }
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      Intent intent = new Intent();
      if (savedInstanceState != null &amp;&amp; savedInstanceState.containsKey("SAVED_INTENT")) {
          intent = savedInstanceState.getParcelable("SAVED_INTENT");
          MyParcel mParcel = intent.getExtras().getParcelable("EXTRA_PARCEL");
      }
  }
  </code></pre>
  
  <p>MyParcel.class</p>
  
  <pre><code>public class MyParcel implements Parcelable, Serializable{
  
      public String parcel_string;
      public List&lt;MyUrl&gt; my_url;
  
      public MyParcel(){
          my_url = new ArrayList&lt;Url&gt;();
      }
  
      public MyParcel(Parcel in){
          parcel_string = in.readString();
          my_url = new ArrayList&lt;MyUrl&gt;();
          in.readTypedList(my_url, MyUrl.CREATOR);
      }
  
      public static final Parcelable.Creator&lt;MyParcel&gt; CREATOR = new Parcelable.Creator&lt;MyParcel&gt;(){
          @Override
          public MyParcel createFromParcel(Parcel in) {
              return new MyParcel(in);
          }
  
          @Override
          public MyParcel[] newArray(int size) {
              return new MyParcel[size];
          }
      };
  
  
      @Override
      public int describeContents() {
          return 0;
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeString(parcel_string);
          dest.writeTypedList(my_url);
      }
  }
  </code></pre>
  
  <p>MyUrl.class</p>
  
  <pre><code>public class MyUrl implements Parcelable, Serializable{
      public String name = null;
      public String content = null;
  
      public MyUrl() {
      }
  
      public MyUrl(Parcel in){
          name = in.readString();
          content = in.readString();
      }
  
      public static final Parcelable.Creator&lt;MyUrl&gt; CREATOR = new Parcelable.Creator&lt;MyUrl&gt;(){
          @Override
          public MyUrl createFromParcel(Parcel in) {
              return new MyUrl(in);
          }
  
          @Override
          public MyUrl[] newArray(int size) {
              return new MyUrl[size];
          }
      };
  
      @Override
      public int describeContents() {
          return 0;
      }
  
      @Override
      public void writeToParcel(Parcel dest, int flags) {
          dest.writeString(name);
          dest.writeString(content);
      }
  }
  </code></pre>
  
  <p>Here's my StackTrace.</p>
  
  <pre><code>03-07 11:17:54.437 5150-5150/? E/Parcel: Class not found when unmarshalling: com.MyParcel
                                           java.lang.ClassNotFoundException: com.MyParcel
                                               at java.lang.Class.classForName(Native Method)
                                               at java.lang.Class.forName(Class.java:400)
                                               at android.os.Parcel.readParcelableCreator(Parcel.java:2507)
                                               at android.os.Parcel.readParcelable(Parcel.java:2461)
                                               at android.os.Parcel.readValue(Parcel.java:2364)
                                               at android.os.Parcel.readArrayMapInternal(Parcel.java:2717)
                                               at android.os.BaseBundle.unparcel(BaseBundle.java:269)
                                               at android.os.BaseBundle.getString(BaseBundle.java:992)
                                               at android.content.Intent.getStringExtra(Intent.java:6211)
                                               at com.MyTest.onCreate(MyTest.java:556)
                                               at android.app.Activity.performCreate(Activity.java:6664)
                                               at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
                                               at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
                                               at android.os.Handler.dispatchMessage(Handler.java:102)
                                               at android.os.Looper.loop(Looper.java:154)
                                               at android.app.ActivityThread.main(ActivityThread.java:6077)
                                               at java.lang.reflect.Method.invoke(Native Method)
                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
                                            Caused by: java.lang.ClassNotFoundException: com.MyParcel
                                               at java.lang.Class.classForName(Native Method)
                                               at java.lang.BootClassLoader.findClass(ClassLoader.java:1346)
                                               at java.lang.BootClassLoader.loadClass(ClassLoader.java:1406)
                                               at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                                               at java.lang.Class.classForName(Native Method) 
                                               at java.lang.Class.forName(Class.java:400) 
                                               at android.os.Parcel.readParcelableCreator(Parcel.java:2507) 
                                               at android.os.Parcel.readParcelable(Parcel.java:2461) 
                                               at android.os.Parcel.readValue(Parcel.java:2364) 
                                               at android.os.Parcel.readArrayMapInternal(Parcel.java:2717) 
                                               at android.os.BaseBundle.unparcel(BaseBundle.java:269) 
                                               at android.os.BaseBundle.getString(BaseBundle.java:992) 
                                               at android.content.Intent.getStringExtra(Intent.java:6211) 
                                               at com.MyTest.onCreate(MyTest.java:556) 
                                               at android.app.Activity.performCreate(Activity.java:6664) 
                                               at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) 
                                               at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599) 
                                               at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
                                               at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
                                               at android.os.Handler.dispatchMessage(Handler.java:102) 
                                               at android.os.Looper.loop(Looper.java:154) 
                                               at android.app.ActivityThread.main(ActivityThread.java:6077) 
                                               at java.lang.reflect.Method.invoke(Native Method) 
                                               at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
                                            Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
  03-07 11:17:54.437 5150-5150/? D/AndroidRuntime: Shutting down VM
  03-07 11:17:54.438 5150-5150/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process: com, PID: 5150
                                                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com/com.MyTest}: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.MyParcel
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
                                                       at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
                                                       at android.os.Handler.dispatchMessage(Handler.java:102)
                                                       at android.os.Looper.loop(Looper.java:154)
                                                       at android.app.ActivityThread.main(ActivityThread.java:6077)
                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
                                                    Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: com.MyParcel
                                                       at android.os.Parcel.readParcelableCreator(Parcel.java:2535)
                                                       at android.os.Parcel.readParcelable(Parcel.java:2461)
                                                       at android.os.Parcel.readValue(Parcel.java:2364)
                                                       at android.os.Parcel.readArrayMapInternal(Parcel.java:2717)
                                                       at android.os.BaseBundle.unparcel(BaseBundle.java:269)
                                                       at android.os.BaseBundle.getString(BaseBundle.java:992)
                                                       at android.content.Intent.getStringExtra(Intent.java:6211)
                                                       at com.MyTest.onCreate(MyTest.java:556)
                                                       at android.app.Activity.performCreate(Activity.java:6664)
                                                       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
                                                       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707) 
                                                       at android.app.ActivityThread.-wrap12(ActivityThread.java) 
                                                       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460) 
                                                       at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                       at android.os.Looper.loop(Looper.java:154) 
                                                       at android.app.ActivityThread.main(ActivityThread.java:6077) 
                                                       at java.lang.reflect.Method.invoke(Native Method) 
                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) 
                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755) 
  </code></pre>