Search code examples
androidspinnersimpleadapter

Populating Spinner with SimpleAdapter in Android


I have used ArrayAdapter to populate the Spinner. I want to know if it can be done using a SimpleAdapter? Please guide me in the right direction. Thanks in advance.


Solution

  • If my answer here (including the follow-up comments) is correct, then you may need to add a ViewBinder to the SimpleAdapter. You can google for examples of ViewBinder implementations -- it doesn't seem to be very complicated.


    EDIT: You do need the ViewBinder, at least for some earlier versions of AndroidOS (I found it's not needed for 2.2). See the other answer, and perhaps also my blog post about this.