作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
final Intent i = new Intent(android.content.Intent.ACTION_SEND);
i.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ txt.getText().toString()});
i.putExtra(Intent.EXTRA_SUBJECT, "Merry Christmas");
i.setType("text/html");
Spanned html =Html.fromHtml("<html><body>h<b>ell</b>o<img src='http://www.pp.rhul.ac.uk/twiki/pub/TWiki/GnuPlotPlugin/RosenbrockFunctionSample.png'>world</body></html>",
new ImageGetter() {
InputStream s;
public Drawable getDrawable(String url) {
try {
s = (InputStream) (new URL(url)).getContent();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Drawable d = Drawable.createFromStream(s, null);
LogUtil.debug(this, "Got image: " + d.getClass() + ", " + d.getIntrinsicWidth() + "x" + d.getIntrinsicHeight());
d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());
return d;
}},null);
i.putExtra(Intent.EXTRA_TEXT, html);
startActivity(Intent.createChooser(i, "Send email"));*
最佳答案
查看此应用程序
此应用程序只能在设备上运行,不能在 android 模拟器上运行..
http://blogingtutorials.blogspot.com/2010/12/send-email-with-attached-file-in.html
关于android - 如何在电子邮件正文中添加图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4543700/
我是一名优秀的程序员,十分优秀!