title: OutOfMemory issue loading several pictures
body: <p>I have nine pictures that I want to load at the start of an activity, and I'm getting problems of OutOfMemory exceptions. At first I loaded them directly in the xml setting its src. So after getting java.lang.OutOfMemory I realized that maybe I needed to load the pictures more efficiently and I created this loop to be executed at the begining of the activity:</p>
  
  <pre><code> for(int i=0;i&lt;9;i++){
          String background = "background"+(i+1);
          int idDrawable = getResources().getIdentifier(background, "drawable", getPackageName());
          int idPicture = getResources().getIdentifier(background, "id", getPackageName());
  
          BitmapFactory.Options options = new BitmapFactory.Options();
          options.inJustDecodeBounds = true;
          BitmapFactory.decodeResource(getResources(), idDrawable, options);
  
          options.inJustDecodeBounds = false;
          ImageView image = (ImageView) findViewById(idPicture);
          image.setImageBitmap(BitmapFactory.decodeResource(getResources(), idDrawable, options));
  }
  </code></pre>
  
  <p>But I still have the same OutOfMemory issue, any ideas on what am I doing wrong?</p>