1

Spinner's onItemSelected callback called twice after a rotation if non-zero position is selected

view story
linux-howto

http://stackoverflow.com – When I create my activity, I setup a Spinner, assigning it a listener and an initial value. I know that the onItemSelected callback is called automatically during application initialization. What I find strange is that this happens twice when the device is rotated, causing me some problems that I will have to circumvent someway. This does not happen if the spinner initial selection is zero. I was able to isolate the issue, here's the simplest activity triggering it: public class MainActivity extends Activity implements OnItemSelectedListener { @Override protected void onCreate(Bundle savedIns (HowTos)