If I attach an object to a bundle and store the bundle in an intent and start another activity, does that activity work on a copy of the original object or does it use the same object but just passes along a pointer?
+3
A:
In Java there is no such thing as pointers. You can either pass and object by value or by reference.
CommonsWare listed the possibilities the following way:
- Use remote services and AIDL to implement a remote procedure call, effectively giving you "pass by reference" between apps
- Use Parceable and Intent extras, effectively giving you "pass by value" between apps
So you pass your objects by value.
Roflcoptr
2010-07-05 13:59:10