Hey, I was wondering how to put a string array in a spinner (I can,
using the ArrayAdapter) but I also want to set keys for these also.
But it seems that there's no constructors for that (I may be
mistaken).
I have 2 arrays: {"5123", "7434", "7333", "7345" } and {"City 1",
"City 2", "City 3", "City 4" }. Obviously, the spinner UI should show
the name array of the cities, but in the backend (what's returned from
the submission of the form is the value.
Anyone knows how?
// Put the array in the spinner
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_spinner_item, cityNames);
spinCities.setAdapter(adapter);
While, I'm the subject of spinners: is there any resource on the
internet describing every type of spinner layouts? I'm using
simple_spinner_item but I find it too small. Any suggestions?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---