On May 17, 5:20 pm, ls02 <[email protected]> wrote:
> We found there are very nasty memory and resource leaks in activities
> and views that we don't know how to handle. I have test app that
> basically starts activity A, that immediately starts activity B and B
> starts A and so forth in infinite loop. Each activity displays its own
> bitmap in image view. After X cycles JVM runs out of memory. There are
> no static or any other references to bitmaps or views or anything
> else.


Is it absolutely necessary to start the Activities in that manner? It
seems to me that the source of your problem is that you are stacking
up a bunch of Activity instances. Can you just return from B back to
A, possibly using startActivityForResult if you need to exchange data
between the Activities?

When you start a new Activity, the previous activity doesn't
necessarily get garbage collected. Check out the Activity lifecycle:
http://developer.android.com/guide/topics/fundamentals.html

-- 
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