title: GridView repeating one image
body: <p>This question has been asked before but I couldn't find an answer so sorry if it is a duplicate question. but my gridView is just repeating the last image i pass to it.</p>
  
  <p>here is my onActivityResult where i select up to six images from the phones gallery</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data)
  {
      super.onActivityResult(requestCode, resultCode, data);
  
      if (resultCode == RESULT_OK)
      {
          if(requestCode == PICK_IMAGE_MULTIPLE)
          {
              ArrayList&lt;Bitmap&gt; items = new ArrayList&lt;Bitmap&gt;();
              String[] imagesPath = data.getStringExtra("data").split("\\|");
  
              try
              {
                  lnrImages.removeAllViews();
              }
              catch (Throwable e)
              {
                  e.printStackTrace();
              }
  
              for (int i=0; i&lt;imagesPath.length; i++)
              {
                  yourbitmap = BitmapFactory.decodeFile(imagesPath[i]);
                  items.add(yourbitmap);
              }
  
              adapter = new ImageAdapter(this, R.id.grdImages, items);
              gridView.setAdapter(adapter);
          }
      }
  }
  </code></pre>
  
  <p>and here is my imageadapter</p>
  
  <pre><code>public class ImageAdapter extends ArrayAdapter&lt;Bitmap&gt;
  {
  Bitmap bm;
  private Context context;
  private ArrayList&lt;Bitmap&gt; items;
  
  public ImageAdapter(Context context, int textViewResourceId, ArrayList&lt;Bitmap&gt; items) {
      super(context, textViewResourceId, items);
      this.context = context;
      this.items = items;
  }
  
  @Override
  public View getView(int position, View convertView, ViewGroup parent)
  {
  
      ImageView imageView;
  
      if (convertView == null)
      {
          imageView = new ImageView(context);
          imageView.setLayoutParams(new GridView.LayoutParams(185, 185));
          imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
          imageView.setPadding(5, 5, 5, 5);
      }
      else
      {
          imageView = (ImageView) convertView;
      }
  
      for (int i = 0; i &lt; items.size(); i++)
      {
          bm = items.get(i);
          imageView.setImageBitmap(bm);
          return imageView;
      }
  
      return imageView;
  
  }
  }
  </code></pre>
  
  <p>thanks for any feed back it is much appreciated as a programmer in training.</p>