title: How do you send an image to Facebook Messenger on Android using Intent.ACTION_SEND?
body: <p>The following code</p>
  
  <pre><code>final Intent sendImage = new Intent(Intent.ACTION_SEND);
  sendImage.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  sendImage.putExtra(Intent.EXTRA_STREAM, theUri);
  sendImage.setType("image/png");
  startActivity(Intent.createChooser(sendImage, "Send Image using "));
  </code></pre>
  
  <p>allows an image to be sent using any app (ex. Dropbox, Gmail, normal Messaging/Texting, Kik), but not the Facebook Messenger app.</p>
  
  <p>Every time I choose the Facebook Messenger app as the app to use to send the photo, I get a "Sorry, Messenger can't handle this file type right now" exception.</p>
  
  <p>The Uri is gotten from this method </p>
  
  <pre><code>File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
  File imageFile = new File(path, "Yogamoji!" + ".png");
  FileOutputStream fileOutPutStream = new FileOutputStream(imageFile);
  BitmapFactory.decodeStream(theAssets.open("emojis/" + fileName)).
  compress(Bitmap.CompressFormat.PNG, 100, fileOutPutStream);
  
  fileOutPutStream.flush();
  fileOutPutStream.close();
  
  return Uri.parse("file://" + imageFile.getAbsolutePath());
  </code></pre>