开发者

image attachment to a mail.. how in android?

开发者 https://www.devze.com 2022-12-24 08:31 出处:网络
i can pick a image and its path using intent. with the use of that path of an image. i have to set that image as attachme开发者_JS百科nt of the mail\'s body content. how its possible in android??? Int

i can pick a image and its path using intent. with the use of that path of an image. i have to set that image as attachme开发者_JS百科nt of the mail's body content. how its possible in android???


Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getString(R.string.emlSendToFriendSubject));
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{emailto});
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,getResources().getString(R.string.emlSendToFriendBody));
File file = getFileStreamPath(EMAIL_TEMP_FILE);
emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+file.getAbsolutePath()));
startActivityForResult(Intent.createChooser(emailIntent, getResources().getString(R.string.btnSendToFriend)),ActMain.EMAIL_DONE);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号