我有一个存储在
中的RSS Feedlist<rssItem> rssItems;
我需要在包含两个文本视图的列表视图中显示,这些视图将是rss feed的标题和描述。
这是rssItem类:
public class RSSItem extends RSSBase {
private final java.util.List<MediaThumbnail> thumbnails;
private String content;
private MediaEnclosure enclosure;
/* Internal constructor for RSSHandler */
RSSItem(byte categoryCapacity, byte thumbnailCapacity) {
super(categoryCapacity);
thumbnails = new java.util.ArrayList<MediaThumbnail>(thumbnailCapacity);
}
/* Internal method for RSSHandler */
void addThumbnail(MediaThumbnail thumbnail) {
thumbnails.add(thumbnail);
}
/**
* Returns an unmodifiable list of thumbnails. The return value is never
* {@code null}. Images are in order of importance.
*/
public java.util.List<MediaThumbnail> getThumbnails() {
return java.util.Collections.unmodifiableList(thumbnails);
}
/**
* Returns the value of the optional <content:encoded> tag
* @return string value of the element data
*/
public String getContent() {
return content;
}
/* Internal method for RSSHandler */
void setContent(String content) {
this.content = content;
}
public MediaEnclosure getEnclosure() {
return enclosure;
}
void setEnclosure(MediaEnclosure enclosure) {
this.enclosure = enclosure;
}
}
目前我只通过以下代码将rssItems的内容记录到调试中:
for(RSSItem rssItem : rssItems) {
Log.i("RSS Title", rssItem.getTitle());
Log.i("RSS Desc", rssItem.getDescription());
Log.i("RSS pubdate", rssItem.getPubDate().toString());
//Log.i("RSS link", rssItem.getLink());
Log.i("RSS Enclosure",rssItem.getEnclosure().getUrl().toString());
}
你能帮我在listview中显示rss feed吗? 感谢