It is worth noting that if the file is located in the internal storage and set to MODE_PRIVATE (what it should be), you must set the file to be readable by other programs before launching the intent. Using the code from the answer,
File F = new File("/path/to/your/file.png"); F.setReadable(true, false); // This allows external program access Uri U = Uri.fromFile(F); Intent i = new Intent(Intent.ACTION_SEND); i.setType("image/png"); i.putExtra(Intent.EXTRA_STREAM, U); startActivity(Intent.createChooser(i,"Email:"));
bkane521 Apr 25 '14 at 17:21 2014-04-25 17:21
source share