title: How to put a Vector into an intent.extra?
body: <p>I've started to write a small app for android. It looks very nice, but there is one thing I don't understand.</p>
  
  <p>I've created a new intent in the activity A and I've added a serialized vector <code>intent.putExtra("key", vector)</code>. On the called activity B I'm doing this: <code>Vector&lt;ItemModel&gt; items = (Vector&lt;ItemModel&gt;) getIntent().getExtras().getSerializable("key")</code>. This line causes a <code>ClassCastException</code>. Does anyone know why? Please help me :-)</p>
  
  <p>Here is the source of the two activities and of the <code>ItemModel</code>:</p>
  
  <p>ItemModel:</p>
  
  <pre><code>public class ItemModel implements java.io.Serializable {
      private static final long serialVersionUID = -1772392719565658730L;
      public int id;
      public String name;
      public String quantity;
      public int status;
  
  }
  </code></pre>
  
  <p>ShoppingListActivity (A):</p>
  
  <pre><code>   public void onClickItems(final View v){
          final Intent intent = new Intent(this,ItemListActivity.class);
  
          Vector&lt;ItemModel&gt; v1 = new Vector&lt;ItemModel&gt;();
          ItemModel item = new ItemModel();
  
          item.name = "Tomaten";
          item.quantity = "400g";
          item.id = 12;
          item.status = 0;
          v1.add(item);
  
          item = new ItemModel();
          item.name = "Bohnen";
          item.quantity = "150g";
          item.id = 13;
          item.status = 0;
          v1.add(item);
  
          item = new ItemModel();
          item.name = "Schokolade";
          item.quantity = "5 Tafeln";
          item.id = 17;
          item.status = 0;
          v1.add(item);
  
          intent.putExtra("ShoppingList", v1);
  
          startActivity(intent);
  </code></pre>
  
  <p>ItemListActivity (B):</p>
  
  <pre><code>   public class ItemListActivity extends Activity {
      @Override
      public void onCreate(Bundle savedInstanceState){
          super.onCreate(savedInstanceState);
          setContentView(R.layout.item);
          ListView list = (ListView) findViewById(R.id.ITEMSLIST);
          final Bundle extras = getIntent().getExtras();
          Vector&lt;ItemModel&gt; items = (Vector&lt;ItemModel&gt;) extras.getSerializable("ShoppingList");
          ArrayList&lt;HashMap&lt;String, Object&gt;&gt; itemsList = new ArrayList&lt;HashMap&lt;String, Object&gt;&gt;();
          HashMap&lt;String, Object&gt; itemMap = new HashMap&lt;String, Object&gt;();
  }
  </code></pre>