问题
Possible Duplicate:
Passing data of a non-primitive type between activities in android
hi... In my android i need to pass ArrayList object from first activity to a second activity through bundles and retrieve the same object in the second activity ...
pls help me with the code ...
thanks :)
回答1:
Have you looked at the docs for Bundle? Android - Bundle docs
If your ArrayList contains simple values, you can use something like putIntArray in the src activity and getIntArray in the dest activity.
Otherwise your ArrayList objects will have to derive from Parcelable and you'll use the put/getParcelableArray methods accordingly.
来源:https://stackoverflow.com/questions/5084355/passing-arraylist-objects-through-bundle