KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a list of values in my XML file which I would like to select based off a spinner selection. For some reason, using an array-string for the spinner works fine, the values are populated into the spinner. For whatever reason, I cannot get the values of the second array to save my life, they are in the same file which has no errors that I can find. Here is the way I am trying to grab them: String[] some_array = getResources().getStringArray(R.array.playerclassdesc_array); The spinner is populated differently (no errors doing this part): ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this, R.array.playerclass_array, android.R.layout.simple_spinner_item); The error I am getting is: "04-26 21:41:35.305: ERROR/AndroidRuntime(514): Caused by: android.content.res.Resources$NotFoundException: String array resource ID #0x7f050001" Which refers directly to the "getResources" line. Does anyone have any clue why this could be happening? Edit: Here is the xml file (it's simple) <?xml version="1.0" encoding="UTF-8"?> <resources> <string name="class_prompt">Choose a class</string> <string-array name="playerclass_array"> <item>Assassin</item> <item>Paladin</item> <item>Pirate</item> <item>Hell Mage</item> <item>Winter Witch</item> <item>Shadow Walker</item> <item>Underthief</item> <item>Red Warrior</item> <item>Haru Norda</item> </string-array> <string-array name="playerclassdesc_array"> <item>This is the Assassin</item> <item>This is the Paladin</item> <item>This is the Pirate</item> <item>This is the Hell Mage</item>
Tags (comma-separated)
Save Edits
Cancel