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. Book: Web On-The-Go

Google Android has been the source of inspiration for this book, Web
On-The-Go.
This book presents innovative ideas with fictionalized examples about
the Wireless Web. It is a book for all policy makers, executives,
engineers and general public.

A Forecast of Innovations for the Wireless Web World. It is a must
read for Tomorrow's Innovating Managers. It reveals innovation's
vulnerabilities, opportunities. Also it shows how to recognize
innovation's dynamics, emergent patters, and predictability.

Title: Web On-The-Go.
Subtitle: A Preview of The Way of Living in the Wireless Web World.
Watch the video: http://www.youtube.com/watch?v=Sv9sxJdy-io

eBook available at:
http://www.booksonboard.com/index.php?BODY=viewbook&BOOK=458654

Your comments and feedback will be very valuable.

Thanks
Bala
--~--~---------~--~----~------------~-------~--~----~

2. Activity not found... sometimes!

I have an app that's currently being beta tested by around 400 helpful
souls.
For 399 of these it's working 100% perfectly.
For 1 it's not.  (he has the same version of CupCake everyone else
has, he has the same version of code everyone else has)

In the onCreate for my main activity I launch (via
'startActivityForResult(...)') a setup activity if necessary.  This is
all per the official documentation, and even takes advantage of the
"if the calling activity has not yet been displayed, it will be
deferred until the new activity returns in order to avoid screen
flickering" (very nice, by the way).  As I say, on 399/400 phones
(mostly G1's) this works perfectly according to spec.

Mr 400 gets told the app exited unexpectedly - every time.

I did some testing, and was able to get the problem to happen to me
ONCE (ever) - the stack-trace showed me that the
'startActivityForResult(...)' method failed with an
'ActivityNotFoundException'.  This was on the emulator, which was
running a bit slow after a tiring day.

The activity in question *is* present, and has worked every time I
have called it except once.

My question is: Is there any reason the runtime would suddenly decide
to ignore an activity?  Is there some strange whackiness that would
cause the PackageManager to have difficulty with the manifest?  (I
only ask this because I have other strange problems with the Installer
not recognizing the app label/icon)

Originally, the Activity in question was being launched by an Intent
that used an intentfilter in the manifest.  After reading a comment by
Diane H I changed it to launch using the class instead (still waiting
on results of that)

Anyone have any ideas?

Doug
--~--~---------~--~----~------------~-------~--~----~

3. App Icon and Name not being shown by Installer

4. Cell Broadcast support on Android

5. BroadcastReceiver and Google Services Inquiry

6. Position of tha zoom in a mapView

7. Error in lowmemorykiller.c "NR_ACTIVE' undeclared (first use in this function)"