AndroidDev
AndroidDev

Reputation: 16385

Android ListView RadioButtons

I have a Custom List View where each item in the List contains a Radio Button. I want only one Radio Box in the List to be selected. How can do this ? If i place the Radio Group on the layout i inflate, each Radio Button will be added to it own group ?

Kind regards, Mateen

Upvotes: 3

Views: 2891

Answers (2)

RaphMclee
RaphMclee

Reputation: 1623

As you have a custom adapter you can yourself uncheck the previously checked radiobutton when a other list item is selected.

Upvotes: 1

user1213202
user1213202

Reputation: 1305

U can set the adapter like this...

setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_single_choice,android.R.id.text1, names));

Refer this link it may helpfull.. http://www.vogella.de/articles/AndroidListView/article.html

Upvotes: 8

Related Questions