Blank option in Spinner

by julius » Tue, 03 Mar 2009 10:43:40 GMT

Sponsored Links

I have a spinner which I would like to add a blank option to so that
by default no choice is selected. I've looked around and in the
Spinner class, but I can't see how to do this. I am just wondering if
there is a method already for doing this.

Thanks for any ideas.


Blank option in Spinner

by Will » Sat, 07 Mar 2009 07:29:42 GMT

 If you're populating your Spinner with a string array I would just
make one item in the array a blank string.


Sponsored Links

Other Threads

1. editor or SVG converter?

Anyone know of a graphical editor that will generate a
I'm looking for something like inkscape that would generate
appropriate commands to generate a or some kind
of conversion utility that would map SVG to an
so it can be used for drawing on a canvas...


2. Timing out an AsyncTask?

I know how to use AsyncTask in a standard manner to manage operations
that are in the background in relation to a UI thread.

However, I want to run a task in the background which might run for a
very long time under certain circumstances. In these cases, I would
like to force the background task to fail if it runs for an excessive
amount of time.

I know that I can invoke the "get(long timeout, TimeUnit unit)" method
of AsyncTask in my UI thread in order to terminate my background task
if it runs too long. However, in that case, my UI will block while
this "get()" command is waiting.

There are probably other drawbacks to directly calling "get()" in this
manner, not the least of which being an evil interaction with the
"done()" method of AsyncTask's contained FutureTask object, which
itself is calling "get()" -- at least this is what I see when I look
at the source code for AsyncTask.

So what is the canonical, Android-approved method for timing out an
overly-long-running AsyncTask?

Thanks in advance.


3. Filter for Custom ListView

4. need suggestion for interface

5. How to use WebView in Offline mode? Can I dynamically revoke permissions?

6. Using Selector to change ImageButton's background while keeping the content image

7. Defining an XML vertical line drawable