Hi!
I need to get an item's position in spinner knowing it's ID. I've tried to do it with Spinner and SpinnerAdapter classes but there are no corresponding methods there.
Thanks,
Aleksander
Hi!
I need to get an item's position in spinner knowing it's ID. I've tried to do it with Spinner and SpinnerAdapter classes but there are no corresponding methods there.
Thanks,
Aleksander
You create the Spinner items via your SpinnerAdapter, so you determine the position of the items. If you create the Spiner items from some kind of collection, you could search that for the ID.
you can query the selected position by Spinner.getSelectedItemPosition()
or alternatively you will get the selected item position if you override the method onItemSelected()