如何使一个电子邮件地址,点击? [英] How to make an email address clickable?

查看:134
本文介绍了如何使一个电子邮件地址,点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序的一些文字,上面写着如果你需要额外的帮助,请给我们发电子邮件,并在这里是电子邮件地址,等等,等等。

I have some text in my application that says in case you need extra help, please email us and here is the email address, blah, blah.

不过,我希望他们能够点击电子邮件中的链接,并有自己的电子邮件客户端开放。那可能吗?或者是不好的做法?

But I want them to be able to click the email link and have their email client open. Is that possible? Or is that bad practice?

如果这是合理的做法,怎么能做到呢?

If it is reasonable practice, how can it be done?

推荐答案

这是一个非常合理的要求和<一href="https://developer.android.com/reference/android/text/util/Linkify.html"><$c$c>Linkify班会变成每一个电子邮件地址,你的一个相应的链接。只需添加的<一个href="https://developer.android.com/reference/android/widget/TextView.html#attr_android%3aautoLink"><$c$c>autoLink属性为您的XML:

This is a very reasonable request and the Linkify class will turn every email address into an appropriate link for you. Simply add the autoLink attribute to your XML:

<TextView
    ...
    android:autoLink="email" />

这篇关于如何使一个电子邮件地址,点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆