0
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");
}
}
}
問題是什麼? – 2011-05-20 08:25:14