title: ImageView OutofMemoryException
body: <p>I have a problem when inserting an image in an ImageView. I have tried several ways to solve it but it still fails, the latest version follows. The image size is 3000x3000.</p>
  
  <p>Code:</p>
  
  <pre><code>ImageView iv = (ImageView) findViewById(R.id.imageView);  
  Bitmap originalBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.prueba_plano_2).copy(Bitmap.Config.ARGB_8888, true);
  iv.setImageBitmap(originalBitmap);
  </code></pre>
  
  <p>XML:</p>
  
  <pre><code> &lt;FrameLayout
          android:id="@+id/root"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"
          android:layout_below="@+id/buttonlayer" &gt;
  
          &lt;ImageView
              android:id="@+id/imageView"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:layout_gravity="center"
              android:adjustViewBounds="true"
              android:contentDescription="@string/desc"
              android:scaleType="matrix" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>Logcat:</p>
  
  <pre><code>06-21 09:32:06.721: E/AndroidRuntime(25709): FATAL EXCEPTION: main
  06-21 09:32:06.721: E/AndroidRuntime(25709): java.lang.OutOfMemoryError
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.Bitmap.nativeCreate(Native Method)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:374)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:404)
  06-21 09:32:06.721: E/AndroidRuntime(25709):    at 
  
  .............
  </code></pre>