Hey, please do excuse my ignorance. Based on you very suggestion, I wrote the following code :
Toast.makeText(QuizSettingsActivity.this, "Detected(again): " + spinner.getSelectedItemPosition(), Toast.LENGTH_SHORT).show(); spinner.setSelection( spinner.getSelectedItemPosition() ); Please enlighten me as to why the getSelectedItemPosition() function displays the currently selected value in my toast but as I try using it in my seSelection call, my spinner never sets to the value confirmed in my above toast ? I also tried assigning the getSelectedItemPosition() return value to a variable and giving it to the toast and the setSelection function as well as casting the return value to an integer .......... didn't resolve my problem. Please help me! On Nov 7, 11:12 pm, Mark Murphy <[email protected]> wrote: > On Sun, Nov 7, 2010 at 6:09 PM,sisko<[email protected]> wrote: > > Hi guys, > > > I have a spinner successfully working but I am trying to use the > > spinner.setSelection method to "remember" the previous spinner value > > when the activity is reloaded. > > > Outside of setOnItemSelectedListener, is there a function of the > > spinner that can give me the selected index? > > getSelectedItemPosition() > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.2 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

