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. finding sprite position relative to background image

can anyone tell me how to find out the relative position of a sprite
image(animated) with respect to a larger-than-screen background image?
i'm developing a time-management game and i want the image to move
along with the background when the background is panned (scrolled).


2. how to disable hint while typing password in android

Hi I am new to this android development.
I have tried to disable the hint from my application
while typing the password but the code doesn,t work.
Could you please suggest any way for it..


3. Gingerbread on Nexus One and spam text messages

4. implementing 2 player interactivity

5. memory hilang kemana ??

6. How to find/associate audio files to my events

7. Android Selangkah Di Depan iPhone dan BlackBerry