[英]How Do I make the href string value a format string in android?
I have a text view with 我有一个文本视图
android:autoLink="web"
and string resource 和字符串资源
<string name="link_text">This is a sample <a href="%1$s"></a> to create</string>
wanted to use something of this sort so i can set the link in code and still get it work using 想使用这种东西,所以我可以在代码中设置链接,并仍然使用它
getString(R.string.link_text, "https:google.com");
You have to use special escape chars : 您必须使用特殊的转义字符:
<string name="link_text">This is a sample <a href="%1$s"></a> to create</string>
Here is a list (I'm not sure if it is complete): 这是一个列表(我不确定它是否完整):
" (" Or ")
' (' Or ')
& (& Or &)
lt(<) (< Or <)
gt(>) (> Or >)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.