title: Setting image Uri in GridView
body: <p>I'm trying to add an image from your phones gallery into a gridView using its uri.
  Unfortunately it doesn't do anything and I can't seem to find a way to make it work. </p>
  
  <p>My Adapter:</p>
  
  <pre><code>public class ImageGridAdapter extends BaseAdapter {
  
  
  public Uri imageUri;
  
  
  private Context mContext;
  
  public ImageGridAdapter(Context c) {
      this.mContext = c;
  }
  
  @Override
  public int getCount() {
  
      return 0;
  }
  
  @Override
  public Object getItem(int position) {
  
      return null;
  }
  
  @Override
  public long getItemId(int position) {
  
      return 0;
  }
  
  
  public View getView(int position, View convertView, ViewGroup parent) {
  
      imageUri = PictureGroupActivity.selectedImage;
  
  
      ImageView imageView;
      if (convertView == null) {
          imageView = new ImageView(mContext);
          imageView.setLayoutParams(new GridView.LayoutParams(85, 85));
          imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
          imageView.setPadding(8, 8, 8, 8);
      } else {
          imageView = (ImageView) convertView;
      }
  
      imageView.setImageURI(null);
      imageView.setImageURI(imageUri);
  
      return imageView;
     }
  }
  </code></pre>
  
  <p>The adpater should be taking the imageUri from onActivtyResult:</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      gridView = (GridView)findViewById(R.id.picture_group_gridView);
  
      if (requestCode == RESULT_LOAD_IMAGE &amp;&amp; resultCode == RESULT_OK &amp;&amp; null != data) {
          selectedImage = data.getData();
          String[] filePathColumn = {MediaStore.Images.Media.DATA};
          Toast.makeText(PictureGroupActivity.this, "selectedImage ma hodnotu: " + selectedImage, Toast.LENGTH_SHORT).show();
  
  
      }
  }
  </code></pre>
  
  <p>I've set the gridView in my onCreate inside my activity as so:</p>
  
  <pre><code>GridView gridView = (GridView)findViewById(R.id.picture_group_gridView);
      gridView.setAdapter(new ImageGridAdapter(this));
  
      gridView.invalidateViews();
  
      gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              Toast.makeText(PictureGroupActivity.this, "You clicked " + position, Toast.LENGTH_SHORT).show();
          }
      });
  </code></pre>
  
  <p>When choosing a photo from the gallery, the gridView remains empty. How do you I make it work? What am I doing wrong ? Thank you in advance.</p>