对于HTML来说,这对我非常有帮助,但是ACTION_SENDTO并不能很好地为我工作-我收到“不支持操作”消息。我在这里找到了一个变体,它可以:
http://www.coderanch.com/t/520651/Android/Mobile/no-application-perform-action-when
这是将两者结合在一起的代码:
String mailId="yourmail@gmail.com";
Intent emailIntent = new Intent(Intent.ACTION_SENDTO,
Uri.fromParts("mailto",mailId, null));
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject text here");
// you can use simple text like this
// emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,"Body text here");
// or get fancy with HTML like this
emailIntent.putExtra(
Intent.EXTRA_TEXT,
Html.fromHtml(new StringBuilder()
.append("
Some Content
").append("http://www.google.com")
.append("
More content
").toString())
);
startActivity(Intent.createChooser(emailIntent, "Send email..."));