当前位置: 动力学知识库 > 问答 > 编程问答 >

android - Adding link to a content parsed from xml file

问题描述:

I am creating a news app.I have succesfully parsed (using sax) the file and added the title in the list view. I want to add link to the title respectively. So once the title is clicked it opens the detailed news of the respective title

How do i add the link to the title.?

this is the xml file i use..

网友答案:

Simply you have create custom Adapter.

Refer this link,

How to change color and font on ListView

textview set as link use below code,

textView.setText(Html.fromHtml(
        "<b>text3:</b>  Text with a " +
        "<a href=\"http://www.google.com\">link</a> " +
        "created in the Java source code using HTML."));

textView.setMovementMethod(LinkMovementMethod.getInstance());

分享给朋友:
您可能感兴趣的文章:
随机阅读: