【发布时间】:2023-03-30 22:28:02
【问题描述】:
我希望在单击电子邮件地址时自动填写邮件。但由于某种原因,html here 不起作用。这是我的代码,希望有人在android中有一些经验。
这是我的 onclicklistener 中的代码:
String link="http://www.thisisthelink.com";
String body=
"following link:<a href="+link+">hier</a>";
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{current.getOuder_email()});
email.putExtra(Intent.EXTRA_SUBJECT, "SUBJECT");
email.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(body));
email.setType("message/rfc822");
startActivityForResult(Intent.createChooser(email, "Email"),1);
【问题讨论】:
-
试试 email.setType("text/html");
-
不起作用:s