[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-15 Thread Dianne Hackborn
But please read what I wrote, do NOT put this in to Intents or usually any Bundle object. This is primarily for communication with services. On Thu, Jan 15, 2009 at 6:49 AM, Inderjeet Singh wrote: > > Thanks, this is perfect for our use-case! > > Just to confirm: if you put an IBinder object in

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-15 Thread Inderjeet Singh
Thanks, this is perfect for our use-case! Just to confirm: if you put an IBinder object in a bundle and it is shared across processes, any changes to the object state through proxy will be communicated back to the process owning the object. Is that correct? I dont know of another operating envir

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-13 Thread Dianne Hackborn
No, this is wrong. - If you are putting normal objects (primitives, Parcelable, Serializable) into the Bundle, they will be copied and re-instantiated as the Intent travels into the system process and back to your app. - If you put IBinder objects in, a reference to the object will be transfered,

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-13 Thread Dianne Hackborn
Keep in mind that java serialization is about the slowest way in the world to get your object from one place to another. :} On Tue, Jan 13, 2009 at 3:02 PM, Geoff Stromberg wrote: > For any Java type that implements interface Serializable, you can use the > Intent methods: > > public Intent p

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-13 Thread Geoff Stromberg
I believe that if you pass an object from one activity (as in android.app.Activity) to another activity using Intent extras, and both activities belong to the same process (which is the default if they belong to the same .apk), then those two activities would be sharing the same in-memory object. H

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-13 Thread Inderjeet Singh
The "Active Objects" heading under http://code.google.com/android/reference/android/os/Parcel.html seem to indicate that activities can share in-memory Java objects as well. Is my understanding correct? Anyone has had any experience with this? Are there any restrictions we should be aware of? Can

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-13 Thread Geoff Stromberg
For any Java type that implements interface Serializable, you can use the Intent methods: public Intent putExtra(String name, Serializable value) public Serializable getSerializableExtra(String name) There's also a bunch of more type-specific put/get methods on Intent. On Tue, Jan 13,

[android-developers] Re: Can Intents contains Rich Java Objects?

2009-01-13 Thread Dianne Hackborn
You can include everything defined in the Intent API. On Tue, Jan 13, 2009 at 1:58 PM, inder wrote: > > Can an activity receive Java objects in an Intent? Or the Intents must > deal with string or byte[] only? > > Thanks > Inder > > > > -- Dianne Hackborn Android framework engineer hack...@an