Android Kotlin onItemSelectedListener for spinner not working

后端 未结 6 1144
盖世英雄少女心
盖世英雄少女心 2021-02-03 18:12

I have a spinner with some items (strings). I want to add the selected items to a list. I read online that I should use the onItemSelectedListenerrather than the

6条回答
  •  爱一瞬间的悲伤
    2021-02-03 18:31

    instead of:

    var spinnerArray = arrayOf("Dumbell", "Punching Bag", "Yoga Ball", "Skipping Rope")
    

    try

    var spinnerArray = mutableListOf("Dumbell", "Punching Bag", "Yoga Ball", "Skipping Rope")
    

    just had the same situation when I was trying to get a sqlite table´s $_ID and populate the spinner with them

提交回复
热议问题