直到昨天它运行得非常好......我是android编程的新手,任何帮助都会很棒......在我的应用程序中,我正在解析下载的xml文件,然后创建一个动态UI......这是我的代码片段..
private class ParseXML extends AsyncTask<Integer, Integer, Document>{
public void onPostExecute(Document d) {
ParseDocument(d); }
@Override
protected Document doInBackground(Integer... params) {
// TODO Auto-generated method stub
DocumentBuilderFactory dbf= DocumentBuilderFactory.newInstance();
try {
//Uri uri = Uri.parse("android.resource://com.example.xml_parser/raw/options");
InputStream is=getResources().openRawResource(R.raw.options);
DocumentBuilder db = dbf.newDocumentBuilder();
dom=db.parse(is);
Log.i(TAG,"parsing done");
}
catch(ParserConfigurationException pce){
pce.printStackTrace();
}
catch(SAXException se){
se.printStackTrace();
}
catch(IOException ioe){
ioe.printStackTrace();
}
return dom;
}