tags:

views:

119

answers:

1

I'm creating a spinner and I've added an OnItemSelectedListener to it. However I've noticed that it fires on create. Now I was wondering if there was a way to ignore/discard it.

I know I could use a boolean value, but that's a bit "dirty".

A: 

Try holding off adding your OnItemSelectedListener until after you have set the adapter on the Spinner, and see if that helps.

CommonsWare
Unfortunately, it doesn't help, at least on 2.2 the listener is firing even when I set it after setting the adapter. Issue is reproducible with the tutorial from http://developer.android.com/resources/tutorials/views/hello-spinner.html
CrazyCoder