public class Bill implements parcelable{//order number public int orderid;//original system idpublic int oldid;//Order address public String address;// Order notes public string ext;//order telephone public string mobile;//order user name public string name;//paid amount public double payed;//order time public St Ring date;//Order Total public double total;//required payment public double pay;//store name public string shopname;//store phone public string Shopphone ;//order status, 0 to be determined, 1 determined public int state;//accept this order employee public int staff;//whether delivery, 0 not delivered, 1 delivery public int type;//Cargo public Goods goods[];p Ublic bill () {//TODO auto-generated constructor stub} protected bill (Parcel in) {OrderID = In.readint (); oldid = In.readint (); Address = in.readstring (); ext = in.readstring (); Mobile = in.readstring (); Name = In.readstring (); payed = In.readdouble (); Date = In.readstring (); Total = In.readdouble (); Pay = In.readdouble (); Shopname = In.readstring (); Shopphone = In.readstring (); State = In.readint (); Staff = in. ReadInt (); Type = In.readint (); parcelable[] Parcelables = In.readparcelablearray (Goods.class.getClassLoader ()); if (parcelables! = null) {goods = arrays.copyof (Parcelables, Parcelables.length, Goods[].class);} } @Override public int describecontents () {return 0; } @Override public void Writetoparcel (Parcel dest, int flags) {dest.writeint (OrderID); Dest.writeint (oldid); Dest.writestring (address); dest.writestring (EXT); Dest.writestring (mobile); Dest.writestring (name); Dest.writedouble (payed); Dest.writestring (date); Dest.writedouble (total); Dest.writedouble (pay); Dest.writestring (Shopname); Dest.writestring (Shopphone); Dest.writeint (state); Dest.writeint (staff); Dest.writeint (type); Dest.writeparcelablearray (goods, flags); } @SuppressWarnings ("unused") public static final parcelable.creator<bill> Creator= new Parcelable.creator<bill> () {@Override public Bill createfromparcel (Parcel in) {Retu RN new Bill (in); } @Override Public bill[] NewArray (int size) {return new bill[size]; } };}
The goods object implements the Parcelable interface
Create a parcelable that contains an array of objects in Android