Passing ArrayList Objects through Bundle?

5.2k views Asked by At

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

There are 1 answers

1
typo.pl On

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.