But that's the whole point: if mDirectories is a Spinner, you can't call setOnItemClickListener() or it throws an exception (per the SDK).
The example at the bottom of this page shows the same thing, but again, it doesn't work for a Spinner: http://developer.android.com/intl/de/guide/topics/ui/binding.html On Mar 4, 3:56 pm, TreKing <[email protected]> wrote: > On Thu, Mar 4, 2010 at 5:44 PM, -DC- <[email protected]> wrote: > > Great, but I'm not sure how I use it. Can you provide some sample code > > based on what I've currently got (below)? > > The link I gave you is for setting an ItemSelectedListener. So step one is > to actually create one: > > OnItemSelectedListener oisl = new OnItemSelectedListener() > { > �...@override > onItemSelected(AdapterView<?> parent, View view, int position, long id) > { > // Here you get the index of the item that was clicked, do what you need > > } > > } > > Then just set it: > mDirectories.setOnItemClickListener(oisl); > > ------------------------------------------------------------------------------------------------- > TreKing - Chicago transit tracking app for Android-powered > deviceshttp://sites.google.com/site/rezmobileapps/treking -- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en

