title: imageView.setImageResource the error and Unfortunately (app) has stopped
body: <p>When it comes to the GridView page I am getting error in the application that 
  in logcat " imageview.setımageresource" looks over the error. 
  but I could not find the solution.</p>
  
  <p>ImageAdapter.java</p>
  
  <pre><code>public class ImageAdapter extends BaseAdapter {
  
      private Context mContext;
  
      public Integer[] birdPicture = { 
              R.drawable.bird1,
              R.drawable.bird2,
              R.drawable.bird3,
              R.drawable.bird4,
              R.drawable.bird5,
              R.drawable.bird6,
              R.drawable.bird7
  
      };
  
      // Constructor
      public ImageAdapter(Context c) {
          mContext = c;
      }
  
      @Override
      public int getCount() {
          return birdPicture.length;
      }
  
      @Override
      public Object getItem(int position) {
          return birdPicture[position];
      }
  
      @Override
      public long getItemId(int position) {
          return birdPicture[position];
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          ImageView imageView = new ImageView(mContext);
          imageView.setImageResource(birdPicture[position]);
          Resources r = Resources.getSystem();
          int px = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
                  90, r.getDisplayMetrics());
          ;
          imageView
                  .setLayoutParams(new GridView.LayoutParams((int) px, (int) px));
          imageView.setScaleType(ImageView.ScaleType.FIT_XY);
  
          return imageView;
      }
  
  }
  </code></pre>
  
  <p>logCat work here</p>
  
  <pre><code>    06-09 17:48:59.996: E/AndroidRuntime(29106): java.lang.OutOfMemoryError
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:677)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:507)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:872)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.content.res.Resources.loadDrawable(Resources.java:3024)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.content.res.Resources.getDrawable(Resources.java:1586)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.ImageView.resolveUri(ImageView.java:648)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.ImageView.setImageResource(ImageView.java:377)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at com.example.proje1.ImageAdapter.getView(ImageAdapter.java:165)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.AbsListView.obtainView(AbsListView.java:2694)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.GridView.makeAndAddView(GridView.java:1350)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.GridView.makeRow(GridView.java:345)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.GridView.fillDown(GridView.java:287)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.GridView.fillGap(GridView.java:247)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.AbsListView.trackMotionScroll(AbsListView.java:6682)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:5687)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:803)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.view.Choreographer.doCallbacks(Choreographer.java:603)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.view.Choreographer.doFrame(Choreographer.java:572)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:789)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.os.Handler.handleCallback(Handler.java:733)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.os.Handler.dispatchMessage(Handler.java:95)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.os.Looper.loop(Looper.java:157)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at android.app.ActivityThread.main(ActivityThread.java:5356)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at java.lang.reflect.Method.invokeNative(Native Method)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at java.lang.reflect.Method.invoke(Method.java:515)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
  06-09 17:48:59.996: E/AndroidRuntime(29106):    at dalvik.system.NativeStart.main(Native Method)
  06-09 17:49:02.301: I/Process(29106): Sending signal. PID: 29106 SIG: 9
  </code></pre>