There are two ways to pass an object intent:
Way One: Serializable way
Way two: Parcelable Way
Here is not much to introduce, this is a quick start using the tutorial, as for the detailed principles introduced, please see this article http://www.cnblogs.com/kexing/p/8270667.html
We first download a plug-in Android parcelable code generator in Android studio, after the installation is complete restart Android Studio, we create a Java bean class, write the member variables, Directly quickly generate getter and setter, then press Alt+insert, select Pareclable in the Prompt box that appears
Then we can use it ourselves, and in the first activity, TEMP is the object of a book class.
New Intent (firstactivity. this, secondactivity. class ); Intent.putextra ("result", temp); StartActivity (intent);
After that, it is received in the second activity, written on
Book book = Getintent (). Getparcelableextra ("result");
Here the old version needs to add a transformation, the new will be prompted to say is superfluous, to see the situation
Book book = (book) getintent (). Getparcelableextra ("result");
Android Development--passing objects using intent