title: Getting Image from ImageView
body: <p>I have a gallery that shows an array of images, when clicked they are displayed in an imageview. I want to be able to SHARE the image that is currently being displayed in an intent chooser. I can't figure out how to select the current image.</p>
  
  <p>Gallery code:</p>
  
  <pre><code>public View getView(int position, View convertView, ViewGroup parent) {
          ImageView imageView = new ImageView(mContext);
  
          imageView.setImageResource(mImageIds[position]);
          imageView.setLayoutParams(new Gallery.LayoutParams(150, 120));
          imageView.setScaleType(ImageView.ScaleType.FIT_XY);
          imageView.setBackgroundResource(mGalleryItemBackground);
  
          return imageView;
      }
  </code></pre>
  
  <p>Intent chooser code:</p>
  
  <pre><code>Intent share = new Intent(Intent.ACTION_SEND);
              share.setType("image/png");
  
              share.putExtra(Intent.EXTRA_STREAM,
                      Uri.parse("android.resource://com.appinfluence.fanapp.v1/drawable/" + Integer.toString(R.drawable.alright)));
  
              startActivity(Intent.createChooser(share, "Share Image"));
  </code></pre>
  
  <p>Where it says R.drawable.alright I need that to be a variable of the current image somehow. Any ideas?</p>