android:single option selection in listview radiobutton?
I have a list view which contains a radio button as its item,my Requirement is to select only single radio button in the listview ,The list view radio button item is dynamicaly populating is there any option to select single radio button at a time
i added following properties ,bu开发者_C百科t no changeListView.CHOICE_MODE_SINGLE
please help me
RegardsAugustineHere you go.
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
It will change your listview's selection mode to single.
I think that ListView.CHOICE_MODE_SINGLE is actual for row layout android.R.layout.simple_list_item_single_choice (string and radio button) only. I can not find any sample for multicolumn list view with radio button. There are samples with check box, but check box have not SINGLE CHOICE :(
follow this link..
This example shows how to use choice mode on a list. This list is in CHOICE_MODE_SINGLE mode, which means the items behave like checkboxes.
精彩评论