For your user interfaces, extend Parcelable .
Classes that implement your own interface must also implement the Parcelable interface, including CREATOR .
Then you can add an object that implements its own interface to Intent as follows:
intent.putExtra("thing", thing);
or add an ArrayList containing these objects as follows:
ArrayList<Thing> things; intent.putParcelableArrayListExtra("things", things);
At the end of the activity, Activity can retrieve objects from the Intent as follows:
Thing thing = intent.getParcelableExtra("thing");
or
ArrayList<Thing> things = intent.getParcelableArrayListExtra("things");
source share