You need to implement the Parcelable
interface
public class ConstantData implements Parcelable {
public void writeToParcel(Parcel out, int flags) {
out.writeString(project_title);
....
out.writeString(country);
out.writeList(projectsList); // <<--
}
private ConstantData(Parcel in) {
project_title = in.readString();
....
country = in.readString();
projectsList = in.readList();
I think for the writing of the projectsList
to work, the Project
class also needs to implement Parcelable
.
See e.g. this class for an example.