I want to read an xml file placed in assets/ directory.
I’ve tried this solution (finded online)
InputStream istr = context.getAssets().open("stanza.xml");
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setNamespaceAware(true);
XmlPullParser xrp = factory.newPullParser();
xrp.setInput(istr, "UTF-8");
but return me FileNotFoundException, but the file exists.
Please, help me to understand.
if your code is of your activity you can simply write: