title: Share Image File from cache directory Via Intent~android
body: <p>I am trying to share image file in cache directory, i have the complete path, but not able to send the file in attachments, the code is</p>
  
  <pre><code>File shareImage=Utils.getBitmapFile();
  Log.d("Activity", "get final path in result"+shareImage.getAbsolutePath());
  /*MimeTypeMap mime = MimeTypeMap.getSingleton();
  String ext=shareImage.getName().substring(shareImage.getName().lastIndexOf(".")+1);
  String type = mime.getMimeTypeFromExtension(ext);
  shareIntent.setType(type);
  Intent shareIntent = new Intent(Intent.ACTION_SEND);
  shareIntent.setType("image/*");
  Uri shareImageUri = Uri.fromFile(shareImage);
  Uri shareImageUri = Uri.fromParts("content", shareImage.getAbsolutePath(), null);//("content://"+shareImage.getAbsolutePath()); 
  */
  
  
  Uri shareImageUri = Uri.fromFile(shareImage);
  Log.d("Result ","uri is "+shareImageUri.toString());
  shareIntent.putExtra(Intent.EXTRA_STREAM, shareImageUri);
  startActivity(Intent.createChooser(shareIntent, "Share Results"));
  </code></pre>
  
  <p>the above commented code is not working</p>
  
  <p>the send mail shows attachment,but not receiving end there is not attachment, 
  facebook sharing also shows no image in post</p>
  
  <p>what the reason for this??</p>
  
  <p>I have already seen the following SO Links <a href="https://stackoverflow.com/a/7662164/1225413">how-to-use-share-image-using-sharing-intent-to-share-images-in-android</a> and many others, none of them are able to resolve the issue</p>
  
  <p>P.S.; </p>
  
  <p>1.The aim is to take screenshot of screen save it in cache directory and share it online from there</p>
  
  <p>2.Yes i do have file, I can pull it via DDMS from device and see on system.</p>