On Tue, Feb 16, 2010 at 12:37 AM, Chirayu Dalwadi <chirayu.dalw...@gmail.com
> wrote:

> Hey TreKing, Can u show the code?


Well, I _could_ ... but this is very straightforward so I leave it as
an exercise to the reader =P.

I assume you have a Spinner, it's adapter, and an OnClickListener set up for
the Spinner. Let's say it's showing a list of strings. Then just add a
string "Make your selection..." as the first item in the adapter and check
for index == 0 in the click listener and do nothing in that case.

If your list of objects is more complicated then strings (as is my case),
then it gets a little trickier, but not too bad. For example, if you have a
custom Color object with a toString() method that returns the name ("Red",
"Blue", etc). you would just make a dummy Color object with it's name set to
"Choose a color..." and add that as your first object.

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

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