Spinner focus problem

by [EMAIL PROTECTED] » Mon, 19 May 2008 16:13:59 GMT

Sponsored Links
 Hi everybody,

First of all, sorry for my poor english :-/
I write a program containing a focusable spinner....
I have a thread that update my spinner with a
"mySpinner.setAdapter(new ArrayAdapter(....));"
I add a listener to the action  setOnItemSelectedListener.

When my thread update my spinner, the spinner list is updated and if
the focus was previously to my spinner i receive 2 events from
The first Event is "correct" corresponding on the first element of my
new updated list (why not.. it's correct for me..) but a second event
corresponding to my previous selected item... (like if android
remember what previous element was selected and reset my list to
select this element..).

How may i disable onItemSeletedListener (for example..) when my thread
do a mySpinner.setAdapter( ... ) ?

Spinner focus problem

by vitvikt » Tue, 20 May 2008 13:11:49 GMT

 I use
public class MyActivity extends Activity implements
and I get only one call of the function
        public void onItemSelected(AdapterView parent, View v, int
position, long id) {



Sponsored Links

Spinner focus problem

by [EMAIL PROTECTED] » Wed, 21 May 2008 08:09:37 GMT

 ok, and if you try to do :

my_spinner.setAdapter(new ArrayAdapter(....));
my_spinner.setAdapter(new ArrayAdapter(....));

how many invocation do you have?



Spinner focus problem

by vitvikt » Wed, 21 May 2008 11:34:04 GMT

 Sorry, I did not undrstand, what do yo want.
As I understand now, you have different quantity of invocation for
spinner with focus and without it?
And you don't now, have spinner focus or not?

I did not investigate this problem.
May be parameters of onItemSelected(AdapterView parent, View v, int
position, long id) help you?
Or may be it is possible change focus programmly.
I did not find setFocus() function in Android.



Other Threads

1. Android Dev Phone 1 out of stock


Yesterday I registered in the Android Market Place to be able to
retrieve one of the dev devices. But after I had registered and paid
the fee I was told that the dev phones are currently out of stock.
Since I need one of those devices for my masterthesis I was very
unhappy to hear that it may take "a few weeks".

Does anyone know (or can one estimate) when they might be available


2. xml

how can we reduce the execution time, when we are using xml parser.

If anybody know rely me..........

Thanks in advance.


3. Reuse alertmanager loading-image

4. Many Listviews problem

5. Adding custom objects to JSCore

6. Settings.System.putInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS, 200) does not change real hardware value

7. New Dell Mini Android SmartPhone runs on 3.5 in screen