title: How to fix Android Spinner selection if it is not working?
body: <p>Android Spinner is not working, the API is working and the Spinner's list of items is working. However, the item selection is not working.</p>
  
  <pre><code>class PlayerSignup2Activity : AppCompatActivity() {
  
      private lateinit var positions : List&lt;Position&gt;
  
      val positionSpinner = positionsSpinner
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(com.example.app.R.layout.activity_user_signup2)
  
          //Positions from API
          positions = APIService.getPositions(this)
  
          val spinnerAdapter = ArrayAdapter(this, R.layout.spinner_item, positions)
          spinnerAdapter.setDropDownViewResource(R.layout.spinner_item)
          positionSpinner.adapter = spinnerAdapter
  
      }
  </code></pre>
  
  <p>Spinner list
  <a href="https://i.stack.imgur.com/mL0h6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mL0h6.jpg" alt="Spinner List"></a></p>
  
  <p>After selecting any item</p>
  
  <p><a href="https://i.stack.imgur.com/wFoAz.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wFoAz.jpg" alt="After selecting an item from the list"></a></p>
  
  <p>Any idea on how to fix this?!</p>