In case anyone needs this, here is what I ended up doing:

For each row...

                    RadioButton groupButton = new RadioButton(this);

                    groupButton.setId(index++);

                    //This is a List<RadioButton> I created to hold
all of the buttons since I don't have a RadioGroup
                    groupRadioButtonList.add(groupButton);


                    groupButton.setOnClickListener(new
RadioButton.OnClickListener()
                    {
                        public void onClick(View v)
                        {
                                //Turn on the button now...once clicked, always
clicked with RadioButtons
                                modifyOkButton.setClickable(true);
                                modifyOkButton.setEnabled(true);

                                int id = v.getId();

                                for(RadioButton button :
groupRadioButtonList)
                                {
                                        if(id == button.getId())
                                        {
                                                button.setChecked(true);
                                        }
                                        else
                                        {
                                                //Turn all others off
                                                button.setChecked(false);
                                        }
                                }
                        }

                    });


On Sep 9, 7:23 pm, darrinps <[email protected]> wrote:
> Thank you so much for confirming this. It is a simple thing for me to
> roll my own but I just hate doing a hack if there is a "right" way to
> do it.
>
> On Sep 9, 2:05 pm, Mark Murphy <[email protected]> wrote:
>
> > On Thu, Sep 9, 2010 at 2:58 PM, darrinps <[email protected]> wrote:
> > > Maybe I need to try what you suggest to see it operate, but I'm not
> > > sure I understand how this will work.
>
> > > The reason is that the table has multiple rows with one string and one
> > > button per TableRow. Adding a RadioGroup to a TableRow I would THINK
> > > would have all of the RadioButtons on one row.
>
> > What you want is not supported. RadioButtons must be an immediate
> > child of the RadioGroup for it to work. I thought they were going to
> > relax this restriction, but a student tried it a couple of weeks ago
> > and concluded it is still a problem.
>
> > Hence, if you gotta gotta gotta have each RadioButton in its own
> > TableRow, skip the RadioGroup, and you're going to have to roll your
> > own mutual-exclusion logic.
>
> > --
> > Mark Murphy (a Commons 
> > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android Training in London:http://skillsmatter.com/go/os-mobile-server

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

Reply via email to