在我的应用程序中,我有它,以便用户可以发送电子邮件(下面的代码)
这有效,但我想改进它。有两种可能性:
1.目前,网址显示为字符串。是否可以在电子邮件中显示为链接?
2.在电子邮件中包含图像(mylogo.png),然后单击图像将转到网址
这些都可能吗?
private void sendEmail() {
final UserInfo userInfo = UserInfo.getInstance();
final String highScore = userInfo.getCumulativeScore();
final Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("*/*");
//intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(crashLogFile)); // attach a file
// EXTRA_EMAIL is the recipient, which in this case we don't know, so leave blank and let user fill in
//intent.putExtra(Intent.EXTRA_EMAIL, new String[] {"Extra Email"});
intent.putExtra(Intent.EXTRA_SUBJECT, "Super Quiz High Score");
String url = "https://play.google.com/store/apps/details?id=com.devname.appname";
intent.putExtra(Intent.EXTRA_TEXT, "My high score in the Super Quiz is now " + highScore + "!\n\n" + url);
startActivity(createEmailOnlyChooserIntent(intent, "Send via email"));
}
答案 0 :(得分:1)
完全取决于接收方使用的邮件客户端。如果它是gmail,你运气不好,他们就不会解析链接。