I'm rather new to Android but I have a fair amount of experience in Java. But my actual Problem nearly drives me crazy. In my application I have Spinner which has an ArrayAdapter. I added an OnItemSelectedListener. In this listener I create a dialog where the user can specify some things. If cancel is clicked in the dialog the former spinner selection should be restored. So I call setSelection(int) on the Spinner. But then my dialog gets called again. I also call spinner setSelection(int) in the onCreate method to set the Spinner selection (it should depend on the state of some data). But then my dialog gets called again. But what I want is, set the Spinnerselection programmatically (to always represent the correct state of data) without my dialog appearing. The dialog should only appear when the user manually selects an item. Please can anybody help me?
Thanks in advance
P.S.: Sorry for my english, I'm not a native speaker