When data is passed between activity, it is convenient to encapsulate a lot of data into objects and then pass the entire object over. There are 2 of cases in the object,
One is to implement the Parcelable interface
One is to implement the Serializable interface
Use the Bundle.putserializable (key, object) origin parameter or use Intent.putextra (Key object) to pass the parameter.
But when used, an exception occurs
1.java.io.notserializableexception exception
Cause: The object does not implement the Serializable interface
Workaround: Allow the object to implement the Serializable interface
2.java.lang.runtimeexception exception
Cause: The object does not implement the Parcelable interface
Workaround: Allow the object to implement the Parcelable interface
Rabbit--android Java.lang.RuntimeException:Parcelable encountered IOException writing serializable objec