I have a spinner with some string items. how can i assign an id to each of this items and get the id when the item is clicked.
<string-array name="country_arrays">
<item id=10>Malaysia</item>
<item id=23>United States</item>
<item id=22>Indonesia</item>
<item id=6>France</item>
<item id=5>Italy</item>
<item id=4>Singapore</item>
<item id=3>New Zealand</item>
<item id=2>India</item>
</string-array>
This is my String array. each the item in my string has an array has an id. now how can i get the id when the item is selected. is there any other way to assign ID to the string and get it back when the item is pressed in the spinner?