Skip to content

OutOfMemoryError EXCEPTION in ImageResizer. #1

@humazed

Description

@humazed

when I tried to test ribbit on my phone I faced with that EXCEPTION when I either take pic or choose on, the app crashed and get that exception.

NOTE: Image size my reach to 3 mb.

09-15 16:34:47.607 31973-31973/com.teamtreehouse.ribbit E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.OutOfMemoryError
at android.graphics.Bitmap.nativeCreate(Native Method)
at android.graphics.Bitmap.createBitmap(Bitmap.java:640)
at android.graphics.Bitmap.createBitmap(Bitmap.java:586)
at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:466)
at com.teamtreehouse.ribbit.ImageResizer.resizeImage(ImageResizer.java:29)
at com.teamtreehouse.ribbit.ImageResizer.resizeImageMaintainAspectRatio(ImageResizer.java:57)
at com.teamtreehouse.ribbit.FileHelper.reduceImageForUpload(FileHelper.java:67)
at com.teamtreehouse.ribbit.RecipientsActivity.createMessage(RecipientsActivity.java:174)
at com.teamtreehouse.ribbit.RecipientsActivity.onOptionsItemSelected(RecipientsActivity.java:129)
at android.app.Activity.onMenuItemSelected(Activity.java:2534)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:964)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:514)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:99)
at android.view.View.performClick(View.java:4147)
at android.view.View$PerformClick.run(View.java:17161)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions