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
itemSelected!
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
my_spinner.setOnItemSelectedListener(MyActivity.this);
where
public class MyActivity extends Activity implements
OnItemSelectedListener{
and I get only one call of the function
        public void onItemSelected(AdapterView parent, View v, int
position, long id) {
....

vitvikt

--~--~---------~--~----~------------~-------~--~----~


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?

thks



--~--~---------~--~----~------------~-------~--~----~



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.

vitvikt


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to make children of TableRow selectable

Hi,

I'm making a image gallery with infinite vertical and horizontal
scrolling. I put images inside a ListView to make a column, and put
the ListViews inside a TableRow. However, it seems that child views of
TableRow is not selectable and as a result I can't select the images
in my ListView (easily). Is there a way to pass the events down to
child views of TableRow so they can be selectable?

-- 

2. AutoCompleteTextView performance

Hi All,

Has anyone has experience of working on AutoCompleteTextView with
large number of data sets (~3000 - in string array). I'm working on a
application that has used a this view where user can pick a station
name by typing first few characters. But it appears to be very slow
this size of data set. Any idea of improving performance?

Thanks
Mohammad Haque

-- 

3. How to access system MP3 / AAC decoder?

4. Content Delivery (Ringtones, Wallpaper, Games, etc)

5. App working but GoogleMap not coming (proxy settings working)

6. How to open a nested child PreferenceScreen

7. Please help me with calculating direction from point A to B