title: How to use "Share image using" sharing Intent to share images in android?
body: <p>I have image galley app in that app I placed all the images into the drawable-hdpi folder.
  and i called images in my activity like this :</p>
  <pre><code>private Integer[] imageIDs = {
          R.drawable.wall1, R.drawable.wall2,
          R.drawable.wall3, R.drawable.wall4,
          R.drawable.wall5, R.drawable.wall6,
          R.drawable.wall7, R.drawable.wall8,
          R.drawable.wall9, R.drawable.wall10
  };
  </code></pre>
  <p>So now i want know how do i share this images using sharing Intent i putted sharing code like this :</p>
  <pre><code>     Button shareButton = (Button) findViewById(R.id.share_button);
       shareButton.setOnClickListener(new View.OnClickListener() {
       public void onClick(View v) {
         
          Intent sharingIntent = new Intent(Intent.ACTION_SEND);
          Uri screenshotUri = Uri.parse(Images.Media.EXTERNAL_CONTENT_URI + &quot;/&quot; + imageIDs);
  
          sharingIntent.setType(&quot;image/jpeg&quot;);
          sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
          startActivity(Intent.createChooser(sharingIntent, &quot;Share image using&quot;));  
      
           }
      });
  </code></pre>
  <p>And i have sharing button also when i click on share button Sharing box is opening
  But when i cliked any service mostly its crashing or some services say : unable to open image
  So how i can fix this or is there any othere format code to share images ????</p>
  <p><strong>Edit :</strong></p>
  <p>I tried using the code below. But its not working.</p>
  <pre><code>Button shareButton = (Button) findViewById(R.id.share_button);
       shareButton.setOnClickListener(new View.OnClickListener() {
       public void onClick(View v) {
  
          Intent sharingIntent = new Intent(Intent.ACTION_SEND);
          Uri screenshotUri = Uri.parse(&quot;android.resource://com.android.test/*&quot;);
          try {
              InputStream stream = getContentResolver().openInputStream(screenshotUri);
          } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          sharingIntent.setType(&quot;image/jpeg&quot;);
          sharingIntent.putExtra(Intent.EXTRA_STREAM, screenshotUri);
          startActivity(Intent.createChooser(sharingIntent, &quot;Share image using&quot;));  
  
           }
      });
  </code></pre>
  <p>If don't mind somebody plz correct my above code OR give me a proper example plz How do i Share my images from drawable-hdpi folder</p>