Spinner should only call onItemSelectedListener on user inte

Put your problem here if it does not fit any of the other categories.

Spinner should only call onItemSelectedListener on user inte

Postby dereulenspiegel » Tue Dec 29, 2009 8:29 pm

Hello everyone,

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
dereulenspiegel
Freshman
Freshman
 
Posts: 9
Joined: Mon Aug 17, 2009 6:48 pm
Location: Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Google [Bot] and 21 guests