I am getting an image inforamtion as string from a database and by using that string I create a bitmap image.
Now my question is how am I sending this image and matter also via mail. This image is not stored on the sdcard or anywhere else.
chikka.anddev
- Store that bitmap on your filesystem
Then use following code to attach that file to your email:
File F = new File("/path/to/your/file.png"); 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:"));
来源:https://stackoverflow.com/questions/4759057/how-to-send-an-image-from-a-database-via-mail