tags:

views:

97

answers:

1

I want to create a ListView with a RadioButton in every row. I'm using a CursorAdapter and I'm binding it in the right way, but I cannot manage correctly the RadioButton. I want that at any moment only one RadioButton to be checked (so when I check one, I would like the one that was checked before to uncheck). Furthermore, when I put the RadioButton on the row, I cannot manage anymore the setOnItemClickListener. Do you know any tutorial that will work for me? Or can you give me any info?

A: 

Sorry for the previous ans I was sleepy I guess. Try the following

setListAdapter(new ResourceCursorAdapter(this, android.R.layout.simple_list_item_single_choice, cursor));

listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
josnidhin
This works for AlertDialog, but what about ListView?
you could handle the logic yourself by putting an extra column in your table, not sure if that would be too expensive though.
schwiz
In some ways this will work for me, thank you very much