Skip to content Skip to sidebar Skip to footer

Android Memory Usage Problem On Possibly Using Activitygroup

Android Memory Usage Problem on possibly using ActivityGroup This is a little bit long story that i ended up messing with memory problems. I developed very deep android applicatio

Solution 1:

Try tracking memory allocations while application is in use.

Also, holding references to Bitmap Drawables can produce memory leaks. When a Drawable is added to View, a circular reference is created. So when you hold a reference to Bitmap drawable, it further holds a reference to a View and this View can never be GCed.

The easiest way to avoid it is to extract a bitmap from a Bitmap Drawable and hold a reference to it, then when Activity is restarted/reloaded, you create new Bitmap Drawables from this bitmaps. This is how a Photostream example works (described at the end): Faster screen orientation change

Solution 2:

Solution 3:

I was resetting background image everytime activitygroup created by;

background.setBackgroundResource(R.drawable.background); 

I removed this and left the description in xml, so problem solved. This method causes memory leaks.

Post a Comment for "Android Memory Usage Problem On Possibly Using Activitygroup"