tags:

views:

36

answers:

1

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:

  1. Use remote services and AIDL to implement a remote procedure call, effectively giving you "pass by reference" between apps
  2. Use Parceable and Intent extras, effectively giving you "pass by value" between apps

So you pass your objects by value.

Roflcoptr