So this app I am working on, works just fine on a really old miserable Android 2.3.3 phone. However when running it on the GS4, the GS4 is throwing out of memory exceptions every time is has to load a resource from the drawables, that is predefined in the xml.

<ImageView
        android:id="@+id/ivLearnMore"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:layout_weight="1"
        android:scaleType="fitCenter"
        android:src="@drawable/learn_more" />

For example this Imageview will throw an exception when inflating the layout because it already has an image assigned. (256x256)

what is going on?

05-08 10:33:54.972: E/dalvikvm-heap(24423): Out of memory on a 16777232-byte allocation.
05-08 10:33:54.972: I/dalvikvm(24423): "main" prio=5 tid=1 RUNNABLE
05-08 10:33:54.972: I/dalvikvm(24423):   | group="main" sCount=0 dsCount=0 obj=0x41187b38 self=0x40dd1b68
05-08 10:33:54.972: I/dalvikvm(24423):   | sysTid=24423 nice=0 sched=0/0 cgrp=apps handle=1074533852
05-08 10:33:54.972: I/dalvikvm(24423):   | state=R schedstat=( 0 0 0 ) utm=147 stm=1265 core=0
05-08 10:33:54.972: I/dalvikvm(24423):   at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
05-08 10:33:54.972: I/dalvikvm(24423):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:596)
05-08 10:33:54.972: I/dalvikvm(24423):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:444)
05-08 10:33:54.972: I/dalvikvm(24423):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:817)
05-08 10:33:54.972: I/dalvikvm(24423):   at android.content.res.Resources.loadDrawable(Resources.java:2854)
05-08 10:33:54.972: I/dalvikvm(24423):   at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
05-08 10:33:54.972: I/dalvikvm(24423):   at android.view.View.<init>(View.java:3460)
05-08 10:33:54.972: I/dalvikvm(24423):   at and
Edit
Report