I’ve copied an XML file from /assets to my applications data folder (data/data/package.name/files/). I’m doing this because the user will be able to modify a lot of data, and I want to save that data to the internal memory and then load it again when they restart the app. This all works well, using Root Browser I can see the XML file is properly copied to the data directory.
Now I need to inflate this XML file using a LayoutInflater. How would I access this file? With an XmlResourceParser or XmlPullParser?
You cannot inflate that file using
LayoutInflater. First, you can only inflate layout resources, not arbitrary files. Second, based on the description in your first paragraph, it is not a layout file in the first place.If you want to parse arbitrary XML, use the DOM, SAX, or
XmlPullParser.