Hello in the Google console, this error is often found in the failures and anr tab. I understand the lack of memory for the application. But how to deal with it?

java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeAsset (Native Method) at android.graphics.BitmapFactory.decodeStream (BitmapFactory.javaIne0000) at android.graphics.BitmapFactory.decodeResourceStream (BitmapFactact.actorathactact.actr.act.actr.act.act.act.actics.jpthact.set. graphics.drawable.Drawable.createFromResourceStream (Drawable.java:785) at android.content.res.Resources.loadDrawable (Resources.java:1935) at android.content.res.Resources.getDrawable (Resources.java:664) at android .widget.ImageView.resolveUri (ImageView.java:611) at android.widget.ImageView.setImageResource (ImageView.javaava54) at com.EdwardSark.cutoutascene.Room14.onCreate (Room14.java around 30) at android.app. Activity.performCreate (Activity.java Dep008) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1079) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2035) at android.app.ActivityThread.handleLaunchActivity (ActivityThread .java: 2096) at android.app.ActivityThread.access $ 600 (ActivityThread.java:1 38) at android.app.ActivityThread $ H.handleMessage (ActivityThread.java:1207) at android.os.Handler.dispatchMessage (Handler.java:99) 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 Z1111) at com.android. internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:809) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java ast76) at dalvik.system.NativeStart.main (Native Method)

    1 answer 1

    It is necessary to work correctly with bitmap

    • But I did not use bitmap in the application. - Edward Sargsyan
    • Sure? Bitmap is just ordinary pictures - kandi
    • I thought it was a way of presenting them (pictures). Another such question when you start the application, it seems that all its resources are loaded into the VM (mainly pictures), with the result that it eats about 45 MB of RAM. Is it possible to somehow load the necessary resources at the moment, but not used ones? I hope I understand everything I wrote?)) - Edward Sargsyan
    • one
      ImageView imgView = (ImageView) page.findViewById (R.id.img); imgView.setImageResource (R.drawable.at1); delate (imgView) - kandi
    • Thanks, I will try! - Edward Sargsyan