How to get the specific string from array.xml
<p>I am creating a simple quiz app, that could use the resources of the array.xml
(no external parser, no adapters)</p>

<pre><code>&lt;string-array name="Question1"&gt;
        &lt;item name="Question"&gt;This is Question1&lt;/item&gt;
        &lt;item name="Answer"&gt;option1&lt;/item&gt;
        &lt;item name="option1"&gt;option2&lt;/item&gt;
        &lt;item name="option2"&gt;option3&lt;/item&gt;
        &lt;item name="option3"&gt;option4&lt;/item&gt;
&lt;/string-array&gt;
</code></pre>

<p>I got all the elements with this code</p>

<pre><code>String[] quesArray = getResources().getStringArray(R.array.Question1);
</code></pre>

<p>Now I want to get the string “Answer” , so that it can be further used and manipulated
How Is it possible?
I tried it with</p>

<pre><code>int resId = context.getResources().getIdentifier("Answer", "string", getPackageName());
</code></pre>

<p>but it gives error</p>

<pre><code>android.content.res.Resources$NotFoundException: String resource ID #0x0
</code></pre>
