title: How do I pull a image by gridview position
body: <p>Everything is working normally just picture is not shown</p>
  
  <p>BaseAdapter:</p>
  
  <pre><code>public Bitmap getItem(int position) {
      return bitmaps.get(position);
  }
  </code></pre>
  
  <p>Activity:</p>
  
  <pre><code>Intent i = new Intent(getApplicationContext(), SpcifiesImage.class);
                      // passing array index
                      i.putExtra("id", position);`enter code here`
                      startActivity(i);
  </code></pre>
  
  <p>this is the activity that i want that the image There will :</p>
  
  <pre><code>Intent intent = new Intent(getApplicationContext(), SpcifiesImage.class);
  
      Intent i = getIntent();
  
      // Selected image id
      int position = i.getExtras().getInt("id");
      CustomGrid imageAdapter = new CustomGrid(mContext);
  
      ImageView imageView = (ImageView) findViewById(R.id.imageView3);
      imageView.setImageBitmap(imageAdapter.bitmaps.get(position));
  
  
      // passing array index
      intent.putExtra("mas", massage);
  
      startActivity(intent);
  </code></pre>
  
  <p>CustomGrid:</p>
  
  <pre><code>         Context mContext;
  private Bitmap btimaprecieve;
  List&lt;ParseObject&gt; ParseObjects;
  ArrayList&lt;Bitmap&gt; bitmaps;
  ParseQuery&lt;ParseObject&gt; query;
  ProgressDialog progressDialog;
  int size;
  
  
  public CustomGrid(Context c, ArrayList&lt;Bitmap&gt; bitmaps) {
      mContext = c;
      this.bitmaps = bitmaps;
  
  }
  
  public CustomGrid(Context mContext) {
  }
  
  
  //---returns the number of images---
  public int getCount() {
      return bitmaps.size();
  }
  
  //---returns the ID of an item---
  public Bitmap getItem(int position) {
      return bitmaps.get(position);
  }
  
  @Override
  public long getItemId(int position) {
      return position;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
  
      LayoutInflater inflater = (LayoutInflater) mContext
              .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
      View gridView;
  
      if (convertView == null) {
  
          gridView = new View(mContext);
  
          // get layout from mobile.xml
          gridView = inflater.inflate(R.layout.mobile, null);
  
          // set value into textview
         // TextView textView = (TextView) gridView.findViewById(R.id.grid_item_label);
        //  textView.setText(mobileValues[position]);
  
          // set image based on selected text
          ImageView imageView = (ImageView) gridView
                  .findViewById(R.id.grid_item_image);
         // imageView.setLayoutParams(new GridView.LayoutParams(70, 70));
         // imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
          imageView.setImageBitmap(bitmaps.get(position));
  
  
      } else {
          gridView = (View) convertView;
      }
      return gridView;
  </code></pre>
  
  <p>logcat:</p>
  
  <p>Process: com.example.tepper.myapplication, PID: 16637
      java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.compress(android.graphics.Bitmap$CompressFormat, int, java.io.OutputStream)' on a null object reference</p>