Spinner: text vs value

by droidin.net » Wed, 05 Aug 2009 03:12:19 GMT


Sponsored Links
 I declare my Spinner in the following manner (it's very static so I
have 2 string arrays in array.xml for titles and values)

<Spinner android:id="@+id/searchCriteria" android:entries="@array/
searchBy" android:entryValues="@array/searchByValues">
</Spinner>

I expect spinner.getSelectedItem() to return an array [title, value]
but in fact it returns just a title String. Is it ignoring
android:entryValues? How do I get a value, not a title from it? Is
this doable with XML only or do I need to create adapter and do it
programmatically?

Thanks,

Bo
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Unable to download Honeycomb SDK

Trying to install the 3.0 (honeycomb) preview.

I just spent the last 2 hours working around the "cannot rename
directory because its in use" error and now I am getting a file not
found when the AVD Manager is trying to download the
android-3.0_pre_r01-linux.zip file.  Is anyone else having this issue?

Its supposed to be available at this location but it is not:
http://dl-ssl.google.com/android/repository/android-3.0_pre_r01-linux.zip

Any help or pointers is appreciated.

-- 

2. Faster way to recompile the android framework .java sources and test the effects on the emulator

I'm looking for a faster way to recompile the framework .java files
and test the results on the emulator.

Right now, using the guide at 
http://devtcg.blogspot.com/2009/03/building-running-and-debugging-android.html
.
Make the framework, update snod, restart emulator.
The process is very slow, especially restarting the emulator. The
update while the emulator is running doesn't work at all.

Is there another work flow ?

BR,
Adrian

-- 

3. Android.... using CheckBox with CustomCursorAdpater in ListView

4. Honeycomb emulator on Linux

5. Android 2.3 problem with startAnimation in onCreate or onStart methods

6. VPN Manager Interfaces

7. PrivacyAppCamp in Mountain View 10 Feb 2011