R.array is a class but not an object?
<p>This is for Android, but I believe it's a general Java question, so I'm labelling it as such.</p>

<p>I'm trying to use reflection on R.array to get an array from the list. The arrays are named <code>stringArraySubCategoryX</code> where X is replaced with a number from 0 to 20. This is my code, but I ran into a problem:</p>

<pre><code>Field subCatField = R.array.class.getField("stringArraySubCategory" + position);
subCatergorySpinner.setAdapter(ArrayAdapter.createFromResource(InfoActivity.this, subCatField.getInt(R.array), android.R.layout.simple_spinner_item));
</code></pre>

<p>The problem part is the <code>subCatField.getInt(R.array)</code> bit, which is supposed to return the resource int value of the selected array. But <code>Field.getInt(arg)</code>'s argument is an Object. I checked R.array, and that says <code>public static final class array</code>, but it seems that it's not accepted.</p>

<p>What am I doing wrong?</p>
