I have an arraylist of objects. ie ArrayList.
I want to pass this to a new Activity. I tried to use putParcelableArrayList but it has issues with the object. I remov
You have two options:
Objects in the ArrayList put implement Parceable as required by the method putParcelableArrayList ()
Or the objects can implement Serializable and use the method putSerializable() to add the ArrayList, ie bundle.putSerializable("arraylist", arraylist);
Android passes Object in Bundle by serializing and deserializing (via Serializable or Parcelable). So all of your Objects you want to pass in a Bundle must implement one of those two interfaces.
Most Object serialize easily with Serializable
and it is much simpler to implement Serializable
and add a static UID to the class than to write all the methods/classes required for Parcelable
.