Public class person implements parcelable {// member variable private int ID; private string name; // 1. parcelable must be implemented. creator interface. Otherwise, an error is returned when you obtain the person data, as shown in the following code: // android. OS. badparcelableexception: // parcelable protocol requires a parcelable. creator object called Creator on class COM. um. demo. person // 2. this interface reads the person data from the Percel container and returns the person object to the logic layer. // 3. implement parcelable. the Object Name of the Creator interface must be creator. It is better to report the error mentioned above. // 4. when reading data in the parcel container, the data must be read in the Order stated by the member variables. Otherwise, an error occurred while obtaining the data. // 5. deserialization object public static final parcelable. creator <person> creator = new creator () {@ override public person createfromparcel (parcel source) {// todo auto-generated method stub // The data must be read in the order declared by the member variables. Otherwise, an error occurred while obtaining the data. Person P = new person (); p. setid (source. readint (); p. setname (source. readstring (); Return P ;}@ override public person [] newarray (INT size) {// todo auto-generated method stub return new person [size] ;}}; public int GETID () {return ID;} public void setid (int id) {This. id = ID;} Public String getname () {return name;} public void setname (string name) {This. name = Name ;}@ override public int describecontents () {// todo auto-generated method stub return 0 ;}@ override public void writetoparcel (parcel DEST, int flags) {// todo auto-generated method stub // 1. data must be encapsulated in the order declared by the member variables. Otherwise, an error occurred while obtaining data. // 2. serialized object DeST. writeint (ID); DeST. writestring (name );}}