I have two Activities, in the first one, I instanciate an ArrayList of Object myObject. In the second activity, i need to get this Arraylist. I don't know how to do that with an intent ?
(Object is a class I have created)
Thanks in advance.
If you make your Object class implement Parcelabel you can pack your arraylist into the bundle you send with the intent
see this link for an example
Usually you use Bundle
objects to pass information between Activities, but these only allow for simple type objects. Typically, for passing more complex object types you generally have to construct a static context of some kind and set your values on that, which is then available to the second activity. It feels dirty, but I've got over it in my apps now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With