I have code like:
void init() {
spinner.setOnItemSelectedListener(null);
spinner.setAdapter(prioritiesAdapter);
spinner.setSelection(task.getPriority() - 1);
spinner.setOnItemSelectedListener(this);
}
@Override
public void onItemSelected(AdapterView<?> parent, View v, int
position, long id) {
Log.d(TAG, "itemSelected: " + position);
}
I would expect that I would *not* see debug messages during
initialization, because I explicitly remove the listener before I call
setSelection() and put it back after I'm done.
However, I *do* see the debug messages anyway. It's as if the
selection setting is getting queued up and running later.
So how do I make sure that my event handlers don't run during (re)
initialization?
Thanks in advance,
Dave Orme
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---