Benefit of using Parcelable instead of serializing object

From “Pro Android 2” NOTE: Seeing Parcelable might have triggered the question, why is Android not using the built-in Java serialization mechanism? It turns out that the Android team came to the conclusion that the serialization in Java is far too slow to satisfy Android’s interprocess-communication requirements. So the team built the Parcelable solution. The … Read more

Issue : Passing ArrayList between intents loses data [duplicate]

You can pass an ArrayList the same way, if the E type is Serializable. You would call the putExtra (String name, Serializable value) of Intent to store, and getSerializableExtra (String name) for retrieval. Example: ArrayList<String> myList = new ArrayList<String>(); intent.putExtra(“mylist”, myList); In the other Activity: ArrayList<String> myList = (ArrayList<String>) getIntent().getSerializableExtra(“mylist”);