android - Sparse array as single choice ListView -


i have following data retrieved server:

[   {id: 8, name: "item1"},   {id: 14, name: "item2"},   {id: 30, name: "item3", active: true},   {id: 42, name: "item4"} ] 

i want put data single choice listview (in dialog, using setsinglechoiceitems()) , after user makes choice, send item id server.

how that? solution figured out use helper array keeps mapping between list items (which afaik has go in sequence) , item ids (which pretty random). tried using adapters, didn't figure out how.

make own custom listview , override getview show whatever want in each row. need viewholder class extract custom row list views have made. have @ this:

single choice listview custom row layout


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -