Spinner getting selected string

by matio » Sat, 17 Apr 2010 06:16:30 GMT


Sponsored Links
 Hi everyone, I'm trying to expand a todo list program taken from a
tutorial in a magazine. The problem I'm having is getting the value
from a spinner that is selecting the priority of the item, how do I do
it? I think it is something to do with views but how do I get the
string?

Thanks in advance...

--



Spinner getting selected string

by Bob Kerns » Sat, 17 Apr 2010 10:52:49 GMT


 You have a few options. You can ask the view for the position of the
selected item (getSelectedItemPosition()), or the ID you associated
with that item (getSelectedItemId()), or register listener with
setOnItemSelectedListener().

You can get the associated item with getSelectedItem(). You can get
the associated View with getSelectedView(), and you can extract
relevant state from that. You can also register listeners on items
within the view, if they will be changing state as the result of your
interactions with them.

Use whatever is simplest for your application.



>


Sponsored Links