title: ArrayList cannot be cast to Parcelable
body: <p>I get following Errors:</p>
  
  <ul>
  <li>Key com..BookStatus expected Parcelable but value was a ArrayList</li>
  <li>ClassCastException: ArrayList cannot be cast to Parcelable
  -> and therafter: Unable to start Activity - NullPointerException</li>
  <li><p>the ArrayList do have values of BookStatus Objects (listToPass)</p>
  
  <ul>
  <li>Key com.example.books.BookStatus expected Parcelable but value was a java.util.ArrayList.  The default value  was returned</li>
  <li>Attempt to cast generated internal exception:</li>
  <li>java.lang.ClassCastException: java.util.ArrayList cannot be cast to android.os.Parcelable</li>
  <li>at com.example.books4locals.SearchActivity.onCreate(SearchActivity.java:46) -> which is the bundle.getparcelable method</li>
  </ul></li>
  </ul>
  
  <p>What can i do?</p>
  
  <p><strong>HomeActivity.java</strong></p>
  
  <pre><code>    ArrayList&lt;BookStatus&gt; listToPass = new ArrayList&lt;BookStatus&gt;(); // fill with smthg
  
          protected void onPostExecute(String result) {
  
              if (listToPass != null) {
  
                  Intent i = new Intent(getApplicationContext(),
                          SearchActivity.class);
                  //              ArrayList&lt;BookStatus&gt; bs = new ArrayList&lt;BookStatus&gt; (Arrays.asList(bArr));
  
                  i.putParcelableArrayListExtra("com.example.books.BookStatus", listToPass);
                  startActivity(i);
  </code></pre>
  
  <p><strong>SearchActivity.java</strong></p>
  
  <pre><code>          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              setContentView(R.layout.searchactivity_main);
  
              Bundle bundle = getIntent().getExtras();
              ArrayList&lt;BookStatus&gt; bookStatus = bundle
                      .getParcelable("com.example.books.BookStatus");
  </code></pre>
  
  <p><strong>BookStatus.java</strong></p>
  
  <pre><code>         public class BookStatus implements Parcelable {
  
          public BookStatus() {
          }
  
          public BookStatus(Parcel in) {
              this.bookId=in.readInt();
  
              this.address=in.readString();
              this.name=in.readString();
              this.author=in.readString();
              this.lenderUserId=in.readInt();
              this.isbn=in.readInt();
              this.postcode=in.readString();
              this.town=in.readString();
              this.telnumber=in.readString();
              this.mail=in.readString();
              this.duration=in.readInt();
              }
                          @Override
              public int describeContents() {
                  // TODO Auto-generated method stub
                  return 0;
              }
  
              @Override
              public void writeToParcel(Parcel dest, int flags) {
                  dest.writeInt(this.bookId);
  
                  dest.writeString(this.address);
                  dest.writeString(this.name);
                  dest.writeString(this.author);
                  dest.writeInt(this.lenderUserId);
                  dest.writeInt(this.isbn);
                  dest.writeString(this.postcode);
                  dest.writeString(this.town);
                  dest.writeString(this.telnumber);
                  dest.writeString(this.mail);
                  dest.writeInt(this.duration);
  
              }
  
               public void readFromParcel(Parcel parcel){
                      this.bookId = parcel.readInt();
                      this.address = parcel.readString();
  
                      this.name = parcel.readString();
                      this.author = parcel.readString();
                      this.lenderUserId = parcel.readInt();
                      this.isbn = parcel.readInt();
                      this.postcode = parcel.readString();
                      this.town = parcel.readString();
                      this.telnumber = parcel.readString();
                      this.mail = parcel.readString();
                      this.duration = parcel.readInt();
                    }
  
  
  
  
              public static final Parcelable.Creator&lt;BookStatus&gt; CREATOR = new Parcelable.Creator&lt;BookStatus&gt;() {
  
                   public BookStatus createFromParcel(Parcel in) {
               return new BookStatus(in);
           }
  
                   public BookStatus[] newArray(int size) {
               return new BookStatus[size];
           }
          };
  </code></pre>