I am attempting to parse an xml file referenced by a string using assetmanager, I have had a lot of help thanks to SO and this is what I have so far.
Document doc = db.parse(assetManager.open(Resources.getSystem().getString(R.string.FileName)));
String filename is my questions.xml file, I’m doing this so ultimately I can enforce localization on my app for multiple xml files. However my app is not able to read R.string.FileName, and errors out the application. Can anyone help me out here?
Resources.getSystem()reads only system resources (android.R.x.x).If your code is in an
Activity, use the following:Otherwise, use this: