我正在解析xml新闻源并在logcat中获取解析后的字符串,但无法在列表视图中打印数据valueRequiredException
我的RSS Feed看起来像
<channel>
<item>
<title>abc</title>
<link>link1</link>
<pubDate>pubdate1</pubdate>
</item>
<item>----</item>
<item>--</item>
</channel>
我创建的课程
@Root(name="channel")
public class Channel_root {
@ElementList(data=false,empty=true,inline=false,name="item",required=true)
private List<Items> item;
/**
* @return the item
*/
public List<Items> getItem() {
return item;
}
/**
* @param item the item to set
*/
public void setItem(List<Items> item) {
this.item = item;
}
}
@Root(name="item")
public class Items {
@Element(name="title",required=false)
public String title;
@Element(name="link",required=false)
public String link;
@Element(name="pubDate",required=false)
public String pubDate;
}
提前致谢