title: java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.String when trying to retrieve arrayList items
body: <p>I am sending the arrayList from my main class which is listView to another class which displays details of individual items of the list.</p>
  
  <pre><code> lv.setOnItemClickListener(new OnItemClickListener() {
          public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                  int position, long id) {
   Intent intent = new Intent(ListActivity.this, DetailActivity.class);
   intent.putExtra("event",myList);
   startActivity(intent);
   }
  </code></pre>
  
  <p>Now in DetailActivity.class this is how I get the ArrayList. I can see all the values correctly when I print the arrayList.</p>
  
  <pre><code> Intent i = getIntent();
   ArrayList&lt;String&gt; myList = (ArrayList&lt;String&gt;) getIntent().getSerializableExtra("event");
   System.out.println(myList);
  </code></pre>
  
  <p>Here's how I am trying to retrieve the first value and store it in a variable.</p>
  
  <pre><code>  for (int e=0;e&lt;myList.size();e++)
      {
          String name = myList.get(0);
          System.out.println(name);
      }
  </code></pre>
  
  <p>I get java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.String
  What am I doing wrong here? </p>