Re: [android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread Streets Of Boston
Exactly, You initialize all your *data *(not your views)* *in the appropriate state. Then when the views become visible/available, they get the data and show it correctly. In other words, the view should be getting the data when they become available. Don't 'push' the data to views (that may n

Re: [android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread Kostya Vasilyev
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. getSelectedText

[android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread 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

Re: [android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread Mark Murphy
On Thu, Apr 21, 2011 at 11:17 AM, Keith Wiley wrote: > I have determined the discrepancy.  Your code calls getSelectedItem() > on the spinner.  Mine calls getSelectedTextView().  In your case, you > get a non-null response regardless of the visible status.  In mine, I > get a null if it is initial

[android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread Keith Wiley
I have determined the discrepancy. Your code calls getSelectedItem() on the spinner. Mine calls getSelectedTextView(). In your case, you get a non-null response regardless of the visible status. In mine, I get a null if it is initially gone, but I get a TextView if it is initially visible. Fur

[android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread Andy
Maybe you attach you sub-Layouts to parent Layout which refreshes all child elements when the layout changes. You can hide Elements from a parent layout programmatically - which works fine for my usecase. onCreate : Creates all Elements that may or may not be visible.(In my case is't a Dialog) s

[android-developers] Re: How to initialize visibly "gone" UI elements?

2011-04-21 Thread Keith Wiley
I agree that yours seems to work. I'm trying to figure out the difference between our code now. Thanks. On Apr 21, 6:42 am, Mark Murphy wrote: > I cannot reproduce your problem. > > For example, try: > > http://misc.commonsware.com.s3.amazonaws.com/SpinnerGone.zip > > This is the Selection/Spin