Dynamic Resource Loading Android
<p>how can I do this:</p>

<p>I'm trying to find a way to open resources which name is determined at runtime only.</p>

<p>Let me explain in more details</p>

<p>I want to have a XML that references a bunch of other XML files in the application apk.</p>

<p>for the purpose of explaining lets say the main XML is main.xml and the other XML are file1.xml file2.xml...fileX.xml...</p>

<p>what i want is to read main.xml, extract the name of the xml I want (fileX.xml) for example. and then read fileX.XML.</p>

<p>the problem I face is that what I extract form main.xml is a string and I can't find a way to change that to R.raw.nameOfTheFile</p>

<p>Anybody has an idea?</p>

<p>ps: I don't want to:
- regroup everything in one huge XML file
- hardcode main.xml in a huge switch case that links a number/string to the resource id</p>

<p>Best Regards</p>

<p>Jason Rogers</p>
