RSS Feed and Google's XML Adapter example - Does it work?

▼魔方 西西 提交于 2019-12-13 13:24:22

问题


I'm trying to understand Google's example of XML Adapters as shown at http://developer.android.com/resources/samples/XmlAdapters/index.html, especially as it related to RSS feeds.

I cannot get Google's sample code to compile. The Adapters.java code seems to have several issues with undefined variables, mContext, mFrom, and mTo as used in the XmlCursorAdapter class.

I am new to Android and am trying to get this to work with a API level 4 program.

Has anyone gotten this example to work? Can you offer any insight?


回答1:


ArrayAdapter<RssItem> adapter = new
ArrayAdapter<RssItem>(this,R.layout.style,feed1.getAllItems());
itemlist.setAdapter(adapter);

itemlist.setOnItemClickListener(this);

itemlist.setSelection(0);

just try this example




回答2:


You can find the complete source code of the examples also in the android sdk-samples. There is also an upated version of the XmlAdapters sample for SDK-version 15.

However, I can get it to compile, but it does not run afterwards, but I assume that's due to a configuration issue on my side. You should have a look into the source code which comes delivered right with the sdk. They can be installed via the Android SDK Manager.



来源:https://stackoverflow.com/questions/6334952/rss-feed-and-googles-xml-adapter-example-does-it-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!