Android: memory usage increases every time you click on a tab (when using an ActivityGroup)

I use an activity group in my application to display tabs.

Every time I click on any tab, its total memory load is increased by 1 MB. And also, if I go back to any internal activity inside this tab, its memory usage will increase again.

I am using getLocalActivityManager() to trigger actions.

  //argIntent this is my intent //argActivityId is the id ot activity argIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // the id is stored in an arraylist int intListSize = arlstGroup.size(); arlstGroup.add(intListSize, argActivityId); Window objWindow = getLocalActivityManager().startActivity(argActivityId, argIntent); View objView = objWindow.getDecorView(); setContentView(objView); 

and also I use destroyActivity () to kill every action, but memory usage is still increasing.

Then I tried to kill all the actions from localActivityManger when every helper action starts. The problem still persists.

How can I solve this problem?

Please help me...

+4
source share
1 answer

Do you use large objects (Drawables, Bitmaps, etc.) in your actions? For more information on avoiding memory leaks, see this article:

http://android-developers.blogspot.de/2009/01/avoiding-memory-leaks.html

0
source

All Articles