开发者

class cast exception on using xmlresouceparser with Document

Hi all i have a class cast exception, No idea what is this, Can any one help on this

XmlResourceParser fXmlFile = mn.getResources().getXml(R.layout.savecredentials);
            DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
            Document doc = docBuilder.parse((InputStream) fX开发者_如何学JAVAmlFile); //exception is on //this line


You're casting an XmlResourceParser

XmlResourceParser fXmlFile = mn.getResources().getXml(R.layout.savecredentials);

to an InputStream:

docBuilder.parse((InputStream) fXmlFile);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜