2018年9月16日 星期日

[Android] Stored your customized data object in Spinner with Kotlin

If you want to make the list of your customized data objects be stored in Spinner. Try this...
Step:
      1. write your own data class
      2. override the toString() method of your data class
      3. add it to mutable list
      4. write on onItemSelected listener
      5. get selected item, and retrieval the object of your data class