1

在一个包含在 Android 应用程序中的移动网站上工作。联系我们页面有电子邮件链接

<a href="mailto:support@abc.com" class="contact-button ui-corner-all"><img src="/img/contact_email_icon.png" width="25"/>Email: support@abc.com</a>

如果在浏览器中打开但不能在应用程序中打开,它可以在网页上使用。我希望它提示用户使用电子邮件应用程序以发送电子邮件。请帮忙。

4

1 回答 1

0

您需要做的就是从电子邮件链接中删除图像标签和类标签中的双“”。如果你想要一个图像链接,你必须使用 android ImageView 布局来实现它,而不是 HTML 标签。

TextView email = findViewById(R.id.email);
    String emailText = "<a href='mailto:support@abc.com'>support@abc.com</a>";
    email.setText(Html.fromHtml(emailText));
    email.setMovementMethod(LinkMovementMethod.getInstance());
于 2018-12-16T02:42:21.717 回答