@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Document doc = null;
try {
SAXBuilder builder = new SAXBuilder();
Log.i("inside ","inside");
doc = builder.build(new URL("http://www.rathbones.com/app/symbol.php?name=goog"));
Iterator mainitr = doc.getRootElement().getChildren().iterator();
while(mainitr.hasNext()){
Element mainel = (Element) mainitr.next();
Log.i("inside ","inside");
Log.i("Element: ",mainel.getName());
}
} catch (Exception e) {
Log.e("app", "getXMLForStockCode() > " + e);
}
}
我收到此错误:getXMLForStockCode() > java.io.IOException: Couldn't open http://www.rathbones.com/app/symbol.php?name=goog
可能是什么问题?