I do not understand what the problem is.

01-01 16:05:59.597 12166-12166/com.example.PoemsAndFace E/dalvikvm-heap﹕ Out of memory on a 28311568-byte allocation. 01-01 16:05:59.621 12166-12166/com.example.PoemsAndFace E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.OutOfMemoryError at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:521) at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:374) at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:397) at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:427) at android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:446) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:885) at android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:165) at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:885) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:822) at android.content.res.Resources.loadDrawable(Resources.java:1990) at android.content.res.Resources.getDrawable(Resources.java:673) at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2895) at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:2938) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:279) at android.app.Activity.setContentView(Activity.java:1881) at com.example.PoemsAndFace.Authors.onCreate(Authors.java:14) at android.app.Activity.performCreate(Activity.java:5122) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1084) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395) at android.app.ActivityThread.access$600(ActivityThread.java:162) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5392) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) at dalvik.system.NativeStart.main(Native Method) 

Closed due to the fact that the essence of the issue is incomprehensible by the participants tutankhamun , aleksandr barakin , PashaPash , xaja , Kromster 29 Sep '15 at 19:01 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    2 answers 2

    You can still see how clearly it is on the palm of a stackrack: Somewhere in the XML file of a layout, a picture of too large size is displayed. Perhaps, by the way, it is only part of the problem. Maybe the main part of the memory is eaten somewhere else, up to this point.
    Larger images should be placed in the drawable-nodpi

    PS to select the code as the moderator did, select the entire code with the mouse, and click on {} in the toolbar
    alt text

      There was already a similar question with an identical problem (logs from LogCat): java.lang.OutOfMemoryError when using images

      • The problem is, I delete Main activit when I switch to 2 activites, then I remove 2 activations and go to 3 activations, and when I switch from 3 activations to 2 activations, this error occurs. In debug mode, everything works fine, if you start without debug, there will be this error. If you remove the finish () in the MainActivity then this error will not be. - Andro
      • @xTIGRx means a picture that in 2 activations memory is only clogged the second time. Tell me the resolution of the picture, what do you insert, and on what device does it crash? - Vladyslav Matviienko
      • Lies in a drawable picture 1536 2048 size 383 kb. In the classroom it is written that by clicking on the button from the pictures, the activation and transition is deleted. - Andro
      • 3
        @xTIGRx, calculation time! 1536x2048x8 (height H width X depth) = 25165824 bytes 25165824/1048576 (translated into megabytes for clarity) = 24 MB. As a result, it turns out that the original image is deployed in memory so that instead of 383 kb (you probably still have a picture in jpg), 24 MB goes out, so you have an OutOfMemory error (the RAM limit allocated to the application has been exhausted). My advice to you is to reduce the image at least several times, it is unlikely that you will really need it in such a high resolution. - Helisia
      • one
        @SuperCreeper, which was partially stated on the link above .. - AseN