我试图在about框中添加指向Twitter个人资料的链接。 “常规”的链接,如电子邮件地址和网址由无法让HREF在Android strings.xml中工作
android:autoLink="email|web"
在about.xml处理,但对于Twitter的个人资料页,我需要在我的strings.xml使用HTML代码。我已经试过:
<string name="twitter">Follow us on <a href=\"http://www.twitter.com/mytwitterprofile">Twitter: @mytwitterprofile</a></string>
这使得在关于对话框HTML标记。
我也试过:
<string name="twitter">Follow us on <a href="http://www.twitter.com/mytwitterprofile">Twitter: @mytwitterprofile</a></string>
其中显示文本“在Twitter上关注我们:@mytwitterprofile”,但它不是一个超链接。
我该如何做这个看似简单的任务!?
干杯, 巴里
你如何将字符串添加到您的框? – rajath 2011-04-22 12:52:01
TextView textView =(TextView)findViewById(R.id.about_content); \t \t textView.setTextColor(Color.WHITE); (getString(R.string.about_text,getString(R.string.twitter),getString(R.string.email_address),getString(R.string.website)));}}; – barry 2011-04-22 16:01:48
看看你是否觉得这篇文章有用 - http://stackoverflow.com/questions/1997328/android-clickable-hyperlinks-in-alertdialog – rajath 2011-04-22 12:56:54