Android - When bundling List<MyClass> use Parceling or Serializing?
How should List<MyClass>
be properly passed from the main activity to a secondary activity?
From what I understand, there are two ways to bundle data: Parceling
and Serializing
. What are the pros an开发者_开发知识库d cons to each?
Thanks
Parcelable is significantly faster than Serializable -- last I checked, at least an order of magnitude. On the other hand, it does require more work from you, since it doesn't do things automatically. But that is one of the reasons it is so much faster. :)
Generically I strongly recommend staying away from Serializable.
This link on anddev might give you answer in details http://www.anddev.org/bundle_vs_parcel_vs_message-t517.html
Also there is one more article on the same topic. Its here http://www.mooproductions.org/node/6?page=57
Check the android developer site, Parcel , Parcelable and Serializable
精彩评论