A way to look at this which just occurred to me is:

getSelectedItem() has to do with the data backing up the spinner. This works even if the spinner stays hidden / gone the whole time, as it should, since the data backing up the spinner always exists, regardless of UI state.

getSelectedTextView() has to do with the data's presentation. If there spinner stayed hidden, there was never any presentation, and that's the value you're getting.

Makes sense?

-- Kostya

21.04.2011 20:51, Keith Wiley пишет:
I agree, and I can adapt my code to use the selected item instead of
the selected view...but it is worth noting that the consequence of
this is that seemingly identical layouts can yield very different
behavior.  In this case, two layouts containing invisible items can
return either a valid view or a null, which is both dangerous and
somewhat arbitrary...not random of course, but slightly arbitrary.
I'm just pointing that out, I'm not arguing against the optimization
necessarily.


--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
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

Reply via email to