我创建了一个RSS阅读器,列出了listview中的项目.我还想在每个项目下面有一个日期,但我不知道该怎么做.我需要别人的帮助才能使Sub Item文本显示从RSS feed检索到的pubDate.
这是我班上的代码:
public class RSSReader extends Activity implements OnItemClickListener
{
public final String RSSFEEDOFCHOICE = "http://app.calvaryccm.com/mobile/android/v1/devos";
public final String tag = "RSSReader";
private RSSFeed feed = null;
/** Called when the activity is first created. */
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
// go get our feed!
feed = getFeed(RSSFEEDOFCHOICE);
// display UI
UpdateDisplay();
}
private RSSFeed getFeed(String urlToRssFeed)
{
try
{
// setup the url
URL url = new URL(urlToRssFeed);
// create the factory
SAXParserFactory factory …Run Code Online (Sandbox Code Playgroud)