I\'m having a spinner which is populated with a CursorAdapter
. Now when creating that spinner (dynamically) I want to set a default selection different to 0 (0
Try Spinner#setSelection (int position, boolean animate)
with animate = false. I remember a while back I had a similar problem and this did the trick. The internal implementation seems to differ apart from the difference coming from the animate part.
If you know default selected spinner item, it can be written as follows:
Spinner sp = (Spinner) findViewById(R.id.spinner);
sp.setSelection(0); // sets the first item
onItemselectedlistener is called when you change the spinner item selection.