如何在Android的使用RSS嵌入链接标签中的TextView [英] How to embed link tag in textview using RSS in a Android

查看:146
本文介绍了如何在Android的使用RSS嵌入链接标签中的TextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个基本的RSS阅读器读取饲料和列表视图显示出来,然后我再试图通过添加标签和编写自定义适配器对其进行改进,现在,下一步我想实现的是提供基本能力每当一个标题(通过一个TextView显示)被点击/触摸与它相关的链路(链路已经被提取throught他RSS / XML)在浏览器启动。现在,我知道启动链接到浏览器是使用URI,什么造成麻烦的是如何保持与它关联的TextView的链接一个简单的一步到位的事情?

I had made a basic rss reader that reads the feed and display it in listview, then i further tried to improve it by adding tabs and writing a custom adapter,now the next step i want to achieve is to provide the basic capability that whenever a headline (displayed through a textview) is clicked/touched the link associated with it (link has been extracted throught he rss/xml) is launched in the browser. Now, i know that launching the link into browser is an easy one step affair using URI, whats causing trouble is how do i keep the link with the textview it is associated with?

我已经实现了所有onclicklistener我需要弄清楚的是如何能相关链接的检索就可以实现,这样我可以做一个URI了出来,并在浏览器中启动它。
任何帮助将是非常美联社preciated。

I have implemented the onclicklistener all i need to figure out is how can the retrieval of relevant link can be achieved so that i can make a URI out of it and launch it in the browser. Any help would be highly appreciated.

感谢

推荐答案

您应该创建的标题和URL中的包装对象。然后填写与这些对象列表视图中,并获取URL火浏览器的活动。

You should create a wrapper object with the title and the url. then fill the list view with those objects, and get the url to fire the browser activity.

是这样的:

class RssObect {
    string title;
    string url;

    //contructors

    //getters and setters
}

然后设置列表类似列表&LT适配器上; RssObect>清单= getRssFeed(...) ....
然后在项目点击监听器只使用当前选择的项目(list.get(选择).getUrl());

这篇关于如何在Android的使用RSS嵌入链接标签中的TextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆