On Wed, Apr 8, 2009 at 8:27 AM, Ward Willats <[email protected]> wrote:

> If you do a (nested) series of startActivtyForResult() (say 2-3) is
> the view hierarchy of the parent held in memory (yes, I think).


Yes.


> If so, would a good strategy be to setContentView( null ) in onStop()
> of the invoker and put it back onStart() ? (At the expense of UI
> performance.)


If you really have a huge amount of data associated with the view hierarchy,
yeah you can do that...   however (1) there is no guarantee about the
timeliness of onStop() (just some time after the next activity is started)
so this means the app can probably be stressed into running out of memory,
and (2) generally it is better to just release whatever big resources that
you hold rather than throwing away the entire hierarchy.


> (Of course, I guess the right thing is to re-architect to not do this
> in the first place!)


That would be good. :)


> On another topic, does Resources flush its cache in low-memory conditions?


The cache uses weak references, so unused resources are removed after every
gc.

-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to