how can I use internal resource (e.g. R.id.myImage01) as an email attachment?

Posted by Azam on Stack Overflow See other posts from Stack Overflow or by Azam
Published on 2010-12-25T02:29:07Z Indexed on 2010/12/25 2:54 UTC
Read the original article Hit count: 213

Filed under:

how can I use internal resource (e.g. R.drawable.myImage01) as an email attachment? I tried the following code. It shows the file is attach but actually the email gets send without any attachment.

Context context = getApplicationContext();   
String imagePath = context.getFilesDir() + "/" + "myImage01.png";
emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse(imagePath));

Thanks Azam

© Stack Overflow or respective owner

Related posts about android