I want to pass “ArrayList objArrayList” from one activity to second activity and want to receive there. I am creating a simple class in that there are four arraylist. I m creating object of that class and calling method of that class by passing parameters to be added in arraylist. After that I m adding that class object in objArrayList.
HOw can I pass objArrayList from one activity to second activity and receive it there?
Thanks,
Vishakha.
First Context (can be Activity/Service etc)
You have a few options:
1) Use the Bundle from the Intent:
2) Create a new Bundle
3) Use the putExtra() shortcut method of the Intent
New Context (can be Activity/Service etc)
NOTE: Bundles have “get” and “put” methods for all the primitive types, Parcelables, and Serializables. I just used Strings for demonstrational purposes.
Your Arraylist class must be Parcelable or Serializable. So you should subclass it to add these functionalities as I think they miss from the original implementation.
Then look into these other questions they will help you.
Serialization issue with SortedSet, Arrays, an Serializable