Step #1: Use android.R.layout.simple_list_item_single_choice for your
rows, or otherwise switch to CheckedTextView instead of RadioButton.

Step #2: Use android:choiceMode="singleChoice".

This sample project shows this approach the
multipleChoice/android.R.layout.simple_list_item_multiple_choice
scenario, but it could be trivially converted to single choice:

https://github.com/commonsguy/cw-omnibus/tree/master/Selection/Checklist

On Mon, Apr 23, 2012 at 2:08 PM, Farhan Tariq <farhan....@gmail.com> wrote:
> Hi,
>
> I have a listView to which I am adding a number of rows at run time. Each
> row has a radio button in it. I want only one radio button to be selected at
> one time, but currently they are all selectable. How can I achieve that?
> Thanks in advance
>
> Regards,
>
> Farhan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to *Advanced* Android Development_ Version 2.6
Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to