title: BadParcelableException: ClassNotFoundException when unmarshalling: (empty classname)
body: <p>I have a class named AllStatStruct. This class contains three attributes, which are objects of my classes StatStructCycle, StatStructHistory and MatrixStruct. Every class extends the class DataStruct and implements the Parcelable interface. In the implementation of the interface, every class is read and written by using <code>readParceable()</code> or <code>writeParceable()</code>.</p>
  
  <p>In my Activity, I call a SOAP webservice in an AsyncTask and get an object of the class <code>AllStatStruct</code>. This object is passed to the next Activity by creating a <code>Bundle</code>:</p>
  
  <pre class="lang-java prettyprint-override"><code>protected void onPostExecute(final AllStatStruct ass) {
  
      if (ass != null) {
          if (dialog.isShowing()) {
              dialog.dismiss();
          }
  
          Bundle bundle = new Bundle();
          bundle.putParcelable("allStatStruct", ass);
          intent = new Intent(packageContext, PrivateView.class);
          intent.putExtras(bundle);
          startActivity(intent);
  
      } else {
          KreativBarometerMainView.this.showDialog(9999);
      }
  }
  </code></pre>
  
  <p>Marshalling the parcel works well, as I can see at my trace outputs in the LogCat. But when unmarshalling the parcel, a ClassNotFoundException occurs and I have no idea why. This is the trace:</p>
  
  <pre><code>05-11 15:02:59.796: E/AndroidRuntime(8647): Caused by: android.os.BadParcelableException: ClassNotFoundException when unmarshalling: 
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.os.Parcel.readParcelable(Parcel.java:1958)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at de.kreativBarometer.net.structs.AllStatStruct.&lt;init&gt;(AllStatStruct.java:45)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at de.kreativBarometer.net.structs.AllStatStruct$1.createFromParcel(AllStatStruct.java:70)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at de.kreativBarometer.net.structs.AllStatStruct$1.createFromParcel(AllStatStruct.java:1)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.os.Parcel.readParcelable(Parcel.java:1981)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.os.Parcel.readValue(Parcel.java:1846)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.os.Parcel.readMapInternal(Parcel.java:2083)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.os.Bundle.unparcel(Bundle.java:208)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.os.Bundle.getParcelable(Bundle.java:1100)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at de.kreativBarometer.ui.PrivateView.onCreate(PrivateView.java:693)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1628)
  05-11 15:02:59.796: E/AndroidRuntime(8647):     ... 11 more
  </code></pre>
  
  <p>As you can see, there is no name given for the not found class! So it is searching for a class named "" and of course it is not found.</p>
  
  <p>I have no idea, why this occurs. Can someone help me? I already tried to play around with the ClassLoader, but giving the intent an extra classloader and using this one to unmarshall the parcelables does not work.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>As you suggested, I tried to pass the several parts of the AllStatStruct seperately. It works fine with the <code>StatStructCycle</code> and the <code>MatrixStruct</code>, but with the <code>StatStructHistory</code>, there is still an error thrown.</p>
  
  <p>Now, I get a <code>NullPointerException</code>, when I try to unmarshall my ArrayList with <code>StatStructCycle</code>s in it. I commented out the other parts of the history.</p>
  
  <p>I tried to write and read the ArrayList with <code>writeTypedList(List&lt;T&gt; list)</code> and <code>readTypedList(List&lt;T&gt; list, Creator&lt;T&gt; c)</code>, but it is not working either.</p>
  
  <p>As I am using ArrayLists, I also trimmed their capacity to their real size by using <code>trimToSize()</code>, because I thought the "empty" slots of the ArrayList could cause the problem. But again, this is not the case...</p>
  
  <p>Starting the App with the debugger shows, that the marshalled <code>StatStructHistory</code> has no empty values... every attribute or listitem is initialized. I have no idea where this <code>NullPointerException</code> is coming from.</p>
  
  <p>best regards
  htz</p>