title: Android Share Intent file format not supported
body: <p>I am trying to share an image from my drawable folder. It worked before but now for some reason whenever I try to share I will select the person to share it to, and it will give me an message that says: "file format is not supported". For some reason I can't share it with Whatsapp, but I can share it with another app like snapchat. So I know it is getting the correct image.</p>
  
  <p>Here is my sharing code:</p>
  
  <pre><code>Uri imageUri;
  imageUri = Uri.parse("android.resource://" + getPackageName() + "/drawable/" + "image" + String.valueOf(mViewPager.getCurrentItem() + 1));
  //imageUri = Uri.parse("android.resource://" + getPackageName() + R.drawable.image1);
  Log.d("Sharing", "android.resource://" + getPackageName() + "/drawable/" + "image" + String.valueOf(mViewPager.getCurrentItem() + 1));
  Intent sharingIntent = new Intent(Intent.ACTION_SEND);
  //sharingIntent.putExtra(Intent.EXTRA_TEXT, "Ha Ha! Check out this picure I got with todays date! Download the app: http://www.google.com");
  sharingIntent.setType("image/jpg");
  sharingIntent.putExtra(Intent.EXTRA_STREAM, imageUri);
  sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
  startActivity(Intent.createChooser(sharingIntent, "Share via"));
  </code></pre>
  
  <p>Here is an error I got from the logs, but I am not using an ArrayList to share.</p>
  
  <pre><code>W/Bundle: Key android.intent.extra.STREAM expected ArrayList but value was a android.net.Uri$StringUri.  The default value &lt;null&gt; was returned.
  </code></pre>
  
  <p>And what the Log.d prints out:</p>
  
  <pre><code>D/Sharing: android.resource://com.trommelen.okke.scheurkalender/drawable/image155
  </code></pre>