http://developer.android.com/reference/android/widget/AdapterView.html#getSelectedItemPosition()
On Mar 26, 2010 6:10 PM, "[email protected]" <[email protected]> wrote: I want to obtain the index of the selected item in a spinner. I am aware of the method getSelectedItem() which returns the item selected (which might be a String). But i want the index of the selected item. Something equivalent to the setSelection(index) to set the selected item. Of course I can get the selected item and compare it against the array of items to obtain the index, but I hope there is a better way of doing this. Thnx. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected]<android-developers%[email protected]> For more options, visit this group at http://groups.google.com/group/android-developers?hl=en To unsubscribe from this group, send email to android-developers+ unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject. -- You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en To unsubscribe from this group, send email to android-developers+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

