My reply inline..

On Mar 26, 10:59 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> How would you want to make it more transparant?
>
> If you want to kill activities when they are in the background and
> restore them when the user wants to see it again you have to save the
> state of the objects. Saving the state of objects is only possible if
> you marshal the object. If you only have a pointer to an object
> 'owned' by another activity you can't save the object to disk.

Is this not very close to how O.S manage the memory swapping to
database..

>
> - If you save the reference the reference may be invalid by the time
> the activity returns.

Pass by reference could always have another layer and this layer would
either get the object from persitance state or from memory if the
object is alive already.

> - If you save the object the other activity still needs to be able to
> access that object

If the reference is beeing used by other activity, kill only the
activity and not the objects which are beeing referenced by other
activities, the way gc works

> So there is really no other way then to duplicate the object (using
> parceble)

O.S has decided to  killing the activity to release the resources and
more is available for other foreground activities. However, when we do
duplicate the same objects using parceble, we many not save any thing
by killing the activities in background.. Insted I say only kill the
objects which are not referenced, so that duplicating could be
avoided.

 when you want to use the same data in multiple activies, or
> you have to use a seperate shared data source such as a content
> provider, or you have to create some other strategy where you make
> sure the data stays consistent.

Regards,
Nagendra
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to