OutOfMemory exception as I rotating the emulator.

Posted by michael on Stack Overflow See other posts from Stack Overflow or by michael
Published on 2010-04-20T22:51:53Z Indexed on 2010/04/21 0:13 UTC
Read the original article Hit count: 248

Filed under:

I get the following OutOfMemory Error as I rotating my android emulator.

  1. I start with Portrait mode.
  2. I switch to Landscape mode.

And then when I switch back to Portrait mode, I get the following error:

   E/AndroidRuntime(  239): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
    E/AndroidRuntime(  239):        at android.graphics.Bitmap.nativeCreate(Native Method)
    E/AndroidRuntime(  239):        at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
    E/AndroidRuntime(  239):        at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
    E/AndroidRuntime(  239):        at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
    E/AndroidRuntime(  239):        at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
    E/AndroidRuntime(  239):        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
    E/AndroidRuntime(  239):        at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
    E/AndroidRuntime(  239):        at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697)
    E/AndroidRuntime(  239):        at android.content.res.Resources.loadDrawable(Resources.java:1705)
    E/AndroidRuntime(  239):        at android.content.res.Resources.getDrawable(Resources.java:580)

© Stack Overflow or respective owner

Related posts about android