我使用array.xml创建列表并将其填充到listView中 问题是我需要在arrayItem decsription中添加一个超链接文本,所以当我将它填充到listView时它应该链接到我的网站!!!
<string-array name="about_us">
<item><b>What is it all about ?</b>\n\this is a mobile application </item>
<item><b>Where all goods go ?</b>Currently the goods can get delivered only in India.</item>
<item><b>How will I Know more?</b>Click [HERE] to go to our website</item>
</string-array>
有没有办法直接做到这一点?
答案 0 :(得分:0)
Try this way,hope this will help you to solve your problem.
<string name="link">1.Click <a href="http://www.google.com"> here </a> to goto wesite.</string>
textView.setMovementMethod (LinkMovementMethod.getInstance());
textView.setText(Html.fromHtml(getString(R.string.link)));