Skip to main content
deleted 20 characters in body; edited tags; edited title
Source Link
Phantômaxx
  • 38.1k
  • 21
  • 88
  • 122

Unable to set the selected item in a spinnerSpinner

I am retrieving data from a database into an ArrayList, which is then used to populate a spinnerSpinner. This
This all works fine, I can see the items in the dropdown.

However, it does not show the selected item, even though I have used   mySpinner.setSelected(INDEX). It
It does not even run the code in the setOnItemSelectedListener that I created.

I realiserealize there are many similar questions already, but even trawlingcrawling through those answers II've been unable to solve the problem.

TheMy code is given below. Thanks in advance for any help!

Unable to set selected item in a spinner

I am retrieving data from a database into an ArrayList, which is then used to populate a spinner. This all works fine, I can see the items in the dropdown.

However, it does not show the selected item, even though I have used mySpinner.setSelected(INDEX). It does not even run the code in the setOnItemSelectedListener that I created.

I realise there are many similar questions already, but even trawling through those answers I been unable to solve the problem.

The code is below. Thanks in advance for any help!

Unable to set the selected item in a Spinner

I am retrieving data from a database into an ArrayList, which is then used to populate a Spinner.
This all works fine, I can see the items in the dropdown.

However, it does not show the selected item, even though I have used   mySpinner.setSelected(INDEX).
It does not even run the code in the setOnItemSelectedListener I created.

I realize there are many similar questions already, but even crawling through those answers I've been unable to solve the problem.

My code is given below.

edited title
Link
OneCricketeer
  • 193k
  • 20
  • 146
  • 276

Android Studio unable Unable to set selected item in a spinner

add relevant tag
Link
pedrofurla
  • 12.8k
  • 1
  • 41
  • 49
Source Link
John Voss
  • 107
  • 1
  • 5
Loading