我需要在从我的应用程序发送的电子邮件中包含一张图片。我已经编写了包含文本的代码,它工作正常。但我不知道如何包含图像。我的图像位于可绘制文件夹中。我该如何包含它?注意:我浏览了很多帖子,但没有任何帮助。
编辑:
我当前的代码如下
emailIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body,new ImageGetter() {
@Override
public Drawable getDrawable(String source) {
Drawable drawFromPath;
// int path = getActivity().getResources().getIdentifier(source, "drawable", "com.package...");
drawFromPath = (Drawable) getActivity().getResources().getDrawable(R.drawable.ic_launcher);
drawFromPath.setBounds(0, 0, drawFromPath.getIntrinsicWidth(),
drawFromPath.getIntrinsicHeight());
return drawFromPath;
}
}, null));
emailIntent.setType("text/html");