0

I am facing a problem from last many days and i am not able to understand what's going wrong. I have a lay out with 3 buttons (3 more when buttons are pressed ) a background image and a background on the action back. The resolutions of the buttons are 294*286( 32 bit color ), the background image is 367*592 and my screen resolution is 1080*1092

which got from the below code:

    Display display = getWindowManager().getDefaultDisplay();
    android.graphics.Point size = new android.graphics.Point();

    display.getSize(size);

    Log.e("MemoryToUse", Integer.toString(size.x) + "/" + Integer.toString(size.y));

When i used the layout in the setContentView(...) the memory sized increased by 25MB and my total (first)activity ( not the app ) crossed 52Mb's to load.

When i made all the background in the bitmaps as "@null" then the size reduced to 25MB.

I am using the same background and about 3 buttons in every activity but my first activity's layout is taking 25MB while the other activities ( even with more GUI elements and atleast 3 buttons + more line of codes) is taking 20MB(approx).

I need to reduce the first activity's load memory but i have no clue.

Any help/suggestions will be highly appreciated. My Activity is empty ( as i used a blank activity to check how much memory the layout is taking ) and let me know if there are any questions/ or any specific code snippet is needed for any analysis.

Thanks. GB.

GAG'sB
  • 109
  • 1
  • 6

1 Answers1

0

A friend of mine share the below link of stackoverflow and it worked.

Android background image memory usage

Community
  • 1
  • 1
GAG'sB
  • 109
  • 1
  • 6