开发者

RadioButton in ListView

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 wi开发者_运维知识库ll work for me? Or can you give me any info?


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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜