Reputation: 26427
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?
Upvotes: 4
Views: 1585
Reputation: 52249
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.
Upvotes: 4