Directly on the code: the comments are written very clearly.
public class Entry implements parcelable{public int userID; public String username; public Boolean ismale; ook;//serialization objects can be nested, provided that the objects of the 2 classes are returned 0 in almost all cases, regardless of @Override public int describecontents () {return 0;}//Serialization object, Writes an object to the serial Number data structure//flags: Most cases are 0 @Override public void Writetoparcel (Parcel out, int flags) {out.writeint (UserID); Out.writ
Estring (username);
Out.writeint (Ismale 1:0);
Out.writeparcelable (book, 0);
Out.writelist (list) can also be serial number list and map, provided that the list and map inside the data is a serial number of//Out.writemap (map); Public Entry (int userid,string username,boolean ismale) {this.userid = UserID; this.username = username; This.ismale =
Ismale; ///deserialization public static final parcelable.creator<entry> Creator = new creator<entry> () {//Create the original object array of the specified length @Overr IDE public entry[] NewArray (int size) {//TODO auto-generated method stub return new Entry[size]///Create the original object from the object after the serial number @O Verride public Entry Createfromparcel (Parcel source) {//TODO auto-generated method stub return new Entry (source);
}
};
Create the original object from the object after the serial number private Entry (Parcel in) {UserID = In.readint (); username = in.readstring (); Ismale = In.readint () = 1;
In.readparcelable (Thread.CurrentThread (). Getcontextclassloader ());
}
}
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.