I want to pass a list of objects from one activity from another activity. I have one class SharedBooking Below:
public class SharedBooking {
First, make the class of the list implement Serializable.
public class MyObject implements Serializable{}
Then you can just cast the list to (Serializable). Like so:
List list = new ArrayList<>();
myIntent.putExtra("LIST", (Serializable) list);
And to retrieve the list you do:
Intent i = getIntent();
list = (List) i.getSerializableExtra("LIST");
That's it.