Linkify android系统中的TextView [英] Linkify in android TextView
问题描述
我有文本的文本视图这是XYZ开发的产品。对于更多的查询,发送电子邮件至info@abc.com。而且我已经linkifiedinfo@abc.com,但问题是,当我接触到的TextView下面的任何区域,它被连接到电子邮件。我如何确保,该链接已发生只在点击信息@ ....我所使用的模式,Linkify.EMAIL_ADDRESS..nothing似乎工作.. .kindly提出了一些答案
I have a text view with text" This is a product developed by XYZ. For more queries, mail us at info@abc.com. And I have linkified "info@abc.com". But the problem is, whenever I touch any area below the textview, it gets linked to the email. How Do I make sure, the link has to happen only on clicking info@....I used patterns, Linkify.EMAIL_ADDRESS..nothing seem to work...kindly suggest some answers
推荐答案
我有问题以自动链接,所以我把它关掉,而不是我使用的文字HTML格式化加上这个code:
I had problems with automatic links, so I turned it off and instead I am using html formating of the text plus this code:
TextView textView = (TextView) findViewById(R.id.TextBox);
textView.setMovementMethod(LinkMovementMethod.getInstance());
textView.setText(Html.fromHtml(strText));
这是电子邮件中的链接进入&LT; A HREF =电子邮件地址:my@email.com&GT; my@email.com< / A&GT;
An email link goes <a href="mailto:my@email.com">my@email.com</a>
这篇关于Linkify android系统中的TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!