Sending Nested Parcelable with Intent
I am trying to send a Parcelable object which also contains another Parcelable object with Intent. However, I am getting NullPointer Exception. Could you please tell me where I am doing wrong? A.java public class A implements Parcelable { private ArrayList<B> var; public A() { this.var = new ArrayList<B>(); } public void addToB(B b) { var.add(b); } public ArrayList<B> getB() { return var; } public void setB(ArrayList<B> b) { this.var = b; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeTypedList(this.var); }