2

Okay, so in my app I have multiple ImageViews each holding an .png icon. right now there are 7... And yet my app, at random intervals, will crash with a anr dialog (App Not Responding) and it then throws this exception:

10-08 00:14:15.528 32732-32732/com.antechdevelopment.NotificationReminders E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.antechdevelopment.NotificationReminders, PID: 32732
java.lang.OutOfMemoryError
 at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
 at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:677)
 at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:507)
 at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:872)
 at android.content.res.Resources.loadDrawable(Resources.java:3024)
 at android.content.res.Resources.getDrawable(Resources.java:1586)
 at android.app.ApplicationPackageManager.getDefaultActivityIcon(ApplicationPackageManager.java:783)
 at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3466)
 at com.android.internal.policy.impl.PhoneWindow.getDecorView(PhoneWindow.java:1879)
 at android.view.Window.findViewById(Window.java:924)
 at android.app.Activity.findViewById(Activity.java:1965)
 at android.app.Activity1ドル.findViewById(Activity.java:745)
 at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:880)
 at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
 at android.app.BackStackRecord.run(BackStackRecord.java:684)
 at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
 at android.app.Activity.performStart(Activity.java:5435)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
 at android.app.ActivityThread.access900ドル(ActivityThread.java:161)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:157)
 at android.app.ActivityThread.main(ActivityThread.java:5356)
 at java.lang.reflect.Method.invokeNative(Native Method)
 at java.lang.reflect.Method.invoke(Method.java:515)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
 at dalvik.system.NativeStart.main(Native Method)

Does anyone have an idea? I'm pretty stumped and annoyed! Thanks!

asked Oct 8, 2014 at 4:21
1
  • post code of error line number Commented Oct 8, 2014 at 5:35

1 Answer 1

6

Just as the error states, you're running out of memory. This is most likely due to the size of the image and how its being loaded. A lot of libs have been created to solve these issues.

Try using some image loading libraries like one of the ones below. Most likely you'll be able to solve your issue using one of these battle tested libs.

answered Oct 8, 2014 at 4:25
Sign up to request clarification or add additional context in comments.

1 Comment

My images were simple too large! I scaled them down and they're now fine! Thanks!!

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.