On Fri, Jul 22, 2011 at 4:33 PM, Vance <vance0...@gmail.com> wrote:

> Can anyone tell me if the Spinner needs to be in the same layout file as
> the ListView?
>

Same file? No. Same view hierarchy? Yes.

So each can be in it's own file. However, at some point they must be added
to the root view or one of it's children.
Otherwise, what is there for findViewById() to actually find?

So you could have:

spinner.xml <- Has Spinner with ID
listview.xml <- Has ListView with ID
main.xml <- This includes the other two

then

setContentView(main.xml); <- Now findViewById can find the spinner.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to