public class XMLParsingExample extends ListActivity {
String name = null;
private String array_estado[];
private String[] array_ciudad;
private String array_barrio[];
/** Create Object For SiteList Class */
SitesList sitesList = null;
/** Called when the activity is first created. */
@SuppressWarnings("unchecked")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listplaceholder);
/** Create a new layout to display the view */
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(1);
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
XMLReader xr = sp.getXMLReader();
/** Send URL to parse XML Tags */
URL sourceUrl = new URL(
"http://www.arteonline.mobi/iphone/output.php?key=Buenos");
MyXMLHandler myXMLHandler = new MyXMLHandler();
xr.setContentHandler(myXMLHandler);
xr.parse(new InputSource(sourceUrl.openStream()));
}
catch (Exception e)
{
System.out.println("XML Pasin");
}
}
}
答案 0 :(得分:0)
我建议你看一下这个例子。 http://developer.android.com/resources/tutorials/views/hello-listview.html
它可以帮助您了解ListActivity的工作原理。
答案 1 :(得分:0)
我想如果想在ListView上显示你解析的数据
用于从Parse数据生成一个ArrayList 从中创建一个适配器,然后将其设置为Your ListView