如何从由数组字符串创建的无线电组中删除单选按钮



我是Android的新手,正在创建一个将使用RadioButtons进行选择并做一些工作的应用程序,我能够从字符串数组创建RadioButons并能够从选定的RadioButtons获取id,但现在我需要在选择后从RadioGroup中删除RadioButtons

这是我正在使用的代码

            for(int i =0; i<ab.length;i++)
            {
                RadioButton radioButtonView = new RadioButton(this);
                radioButtonView.setText(ab[i]);
                radioGroup.addView(radioButtonView, p);
            }   

我能够将新数组映射到单选按钮,但无法删除旧数组(单选按钮)请帮忙,所以我将继续使用我的应用程序继续谢谢

使用 RadioGroup.removeViewAt(int index)RadioGroup.removeView(View view)RadioGroup.removeViews(int start, int count)

最新更新