Android 基于String.xml在textview中设置超链接
my string.xml字符串行Android 基于String.xml在textview中设置超链接,android,Android,my string.xml字符串行 <string name="companyLink"><a href="http://www.abc.com">abc Technology </a> </string> 但是android只显示html而不显示超链接 在屏幕上 <a href=http://abc.com>abc string </a> 我认为正确的语法是
<string name="companyLink"><a href="http://www.abc.com">abc Technology </a> </string>
但是android只显示html而不显示超链接
在屏幕上
<a href=http://abc.com>abc string </a>
我认为正确的语法是:
我认为正确的语法是:
引号也应该转义,否则Java将在getString()期间删除它们。在“前添加反斜杠”
a href=\”http://www.abc.com\“abc技术/a>
或者这个对我有用的解决方案:
引号也应该转义,否则Java将在getString()期间删除它们。在“之前添加反斜杠”
a href=\”http://www.abc.com\“abc技术/a>
或者这个对我有用的解决方案:
您是否尝试过更改所有
&代码>到和?在HTML实体中使用符号和字符时,不需要对其进行转义。这可能会导致问题。请参阅,您是否尝试更改所有&代码>到和?在HTML实体中使用符号和字符时,不需要对其进行转义。这可能会引起问题。请参阅
<a href=http://abc.com>abc string </a>
<string name="companyLink"><a href=\"http://www.abc.com\">abc Technology </a> </string>