3

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.

Dan Breslau
  • 11,472
  • 2
  • 35
  • 44
Mudassir
  • 13,031
  • 8
  • 59
  • 87

1 Answers1

3

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.

Community
  • 1
  • 1
Dan Breslau
  • 11,472
  • 2
  • 35
  • 44
  • 1
    Thanks dude. Thats really helpful. You got "Accepted Answer" two times for the same answer. ;-) Anyway, can you please tell me how did you figured out that the code is not working on Android 1.6? Do you test every code on every version? – Mudassir Dec 09 '10 at 05:27
  • 1
    Thanks. Hey, I'd have settled for an uprate on the other answer :-) Anyway: no, I didn't test every version of the OS -- in fact, I only have emulators set up for 1.5 and 2.2, and I simply tested the code with those two versions. So, I don't know which version of the OS first fixed the problem. – Dan Breslau Dec 09 '10 at 05:28