Pulling an array from resource file to populate list in android
<p>I'm working through the listbox building example and wanted to alter it to pull an array from the arrays file (going on the separation of code and data thing)</p>

<p>So instead of declaring the array within the class like so</p>

<pre><code>private static final String[] items={"A", "B", "C","D", "E", "F"};
</code></pre>

<p>I have a string array in r.arrays.xml called exercises</p>

<pre><code>&lt;resources&gt;
    &lt;array name="exercises"&gt;
        &lt;item&gt;Kettlebells - Swing, Two handed&lt;/item&gt;
        &lt;item&gt;Kettlebells - Swing, One handed&lt;/item&gt;
        &lt;item&gt;Kettlebells - Squat"&lt;/item&gt;
        &lt;item&gt;Kettlebells - Deadlift"&lt;/item&gt;
        &lt;item&gt;"Kettlebells - Lunge"&lt;/item&gt;
        &lt;item&gt;"Kettlebells - Press&lt;/item&gt;
    &lt;/array&gt;
</code></pre>

<p>Replaced the existing</p>

<pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, items));
</code></pre>

<p>with</p>

<pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, R.array.exercises));
</code></pre>

<p>However, the list doesn't seem to get populated with the array</p>

<p>All help appreciated (from a slightly confused beginner programmer)</p>
