I am using a spinner populating with an xml file:
<string-array name="Spinner Items">
<item>Item 1: 2.0 - 4.0</item>
<item>Item 2: 1.0 - 3.0</item>
Is it possible to set a name value pair like this:
<string-array name="Spinner Items">
<item name="Item 1: 2.0 - 4.0" value="2"></item>
<item name="Item 2: 1.0 - 3.0" value="1.5"></item>
So that I can populate the spinner with the name and then when an item is selected it returns the value of that specific item? I figure it must be easier to do all this in the xml file as opposed to have to write if statement for each item when the spinner is changed. Of course the real xml file is much longer than this snippet.
The only way to do this is to implement a custom adapter-class.