Android Kotlin onItemSelectedListener for spinner not working

后端 未结 6 1147
盖世英雄少女心
盖世英雄少女心 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条回答
  •  猫巷女王i
    2021-02-03 18:19

    I implemented like this. 1. Create Empty Mutable List 2. Set onItemSelectedListner on spinner 3. When user select item add that to mutable list

    Check my this answer for more info. It will help you: Android Koltin pass spinner values to mutable list

提交回复
热议问题