Android development, retrieving values from a string array -
i have array in xml
<string-array name = "locations"> <item value = "kdlh">duluth international airport</item> <item value = "kbji">bemidji</item> <item value = "kaum">austin municipal</item> <item value = "kbde">baudette international airport</item> <item value = "kbbb">benson municipal</item> <item value = "kcbg">cambridge municipal</item> <item value = "kcqm">cook municipal airport </item> <item value = "kcoq">cloquet</item> <item value = "ktob">dodge center airport </item> <item value = "kevm">eveleth</item> <item value = "klxl">little falls</item> <item value = "kmml">marshall</item> <item value = "kane">minneapolis / blaine </item> <item value = "klvn">minneapolis, airlake airport</item> <item value = "kmsp">minneapolis-st. paul</item> </string-array>
i'm trying retrieve value when item selected , not text. how go doing this? i'm able retrieve text doing this. can retrieve selected text , not value attribute.
there's not great solution this. here's how it.
<string-array name="locations"> <item>duluth international airport</item> <item>bemidji</item> <item>austin municipal</item> <item>baudette international airport</item> <item>benson municipal</item> <item>cambridge municipal</item> <item>cook municipal airport </item> <item>cloquet</item> <item>dodge center airport </item> <item>eveleth</item> <item>little falls</item> <item>marshall</item> <item>minneapolis / blaine </item> <item>minneapolis, airlake airport</item> <item>minneapolis-st. paul</item> </string-array> <string-array name="location_values"> <item>kdlh</item> <item>kbji</item> <item>kaum</item> <item>kbde</item> <item>kbbb</item> <item>kcbg</item> <item>kcqm</item> <item>kcoq</item> <item>ktob</item> <item>kevm</item> <item>klxl</item> <item>kmml</item> <item>kane</item> <item>klvn</item> <item>kmsp</item> </string-array>
then can pull value location-values
array.
Comments
Post a Comment