1. Methods
(1) serialization is implemented using the serializable interface. Use Bundle.putserializable (Key, object); Here the Objec object needs to implement the serializable interface.
(2) Realize parcelable interface serialization. Use Bundle.putparcelable (Key, Object), where object objects need to implement the Parcelable interface.
2, the difference between the two:
(1) When using memory, parcelable analogy serializable high performance, it is recommended to use the Parcelable class.
(2) serializable generates a large number of temporary variables at the time of serialization.
(3) Parcelable can not be used in the case of storing data on disk, because Parcelable does not guarantee the continuity of the data in the event of external change. Although serializable efficiency is low and is not advocated, it is recommended to use serializable in this case.
3. Realize:
(1) Serializable implementation, only need to inherit implements serializable can. This simply marks the object and the system automatically serializes it.
(2) Parcelable implementation, you need to add a static member variable in the class creator (must be public, otherwise error), this variable needs to inherit Parcelable.creator interface.
Transferred from: http://blog.csdn.net/wulongtiantang/article/details/7937094
android--What are the methods for passing some binary data through intent