Android passing ArrayList via Bundle
<p>I posted this question yesterday in the Java forum, but it's probably more appropriate in the Android section:</p>

<p><a href="http://stackoverflow.com/questions/14656755/java-object-added-to-arraylist-not-showing">Java object added to ArrayList not showing</a></p>

<p>So I passed an ArrayList via a bundle however whenever I took a subject's Task ArrayList and added something the changes did not appear in the ArrayList.</p>

<p>To fix this instead of casting the Subject I passed the index in the ArrayList and did the subject assignment from the index. </p>

<p>So the Subject assignment was <code>subject = subjectsList.get(index);</code> instead of:</p>

<pre><code>Bundle bundle = getIntent().getExtras();
  if (bundle != null) {
    subject = (Subject) bundle.get("selected_subject");
    subjectsList = (ArrayList&lt;Subject&gt;) bundle.get("subjects_list");
   }
</code></pre>

<p>I'm still casting the ArrayList so I'm not sure why it does n't work when casting the subject. Can anyone explain this please. I think it may be do with the subject not being the same as the one in the ArrayList but I'm not sure.</p>

<p>Also surely the subject and ArrayList created in one activity and passed to another via a bundle are referring to the same object?</p>
