Felix
Felix

Reputation: 3486

Bind JSONArray to adapter

How would you go about to bind a JSONArray to an adapter, the adapter will be used to bind data to a spinner.

Of course I could iterate over the strings in the JSONArray and add 'em to a String array, but that seems cumbersome.

Upvotes: 2

Views: 1040

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007659

Create your own adapter class, extending BaseAdapter, that adapts your JSON data according to whatever rules you feel are appropriate. The built-in adapter classes are not well-suited for JSON data.

Upvotes: 1

Related Questions