On a button click, I want to load a spinner with data from a table. So I use a SimpleCursorAdapter which I pass to spinner.SetAdapter. After that, I do some other code. After all of this, the OnSelectedItem event of my spinner is fired and I don't know why (like a post event). I noticed that if I don't call spinner.SetAdapter, the event is not fired. To make is easier to understand, here is my code (simplified):
onClick{
// Here I load the SimpleCursorAdapter before the next line
spinner.SetAdapter(lSimpleCursorAdapter);
DoSomeCode();
}
// Then after the OnClick, the OnSelectedItem event of my spinner is fired, I don't know why
Do someone knows what the problem would be?