how to generate dynamic RadioButton with a radiongroup in adapterView?

戏子无情 提交于 2019-12-01 00:54:48
  <RadioGroup 
            android:id="@+id/optionRadioGroup"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" > 
   </RadioGroup>

//here i am adding 6 radiobutton .

rgroup=(RadioGroup)findViewById(R.id.optionRadioGroup);

for(int i=0; i<6; i++)
{
       rb[i]=new RadioButton(context);
       rb[i].setText("rdo"+i);
       rb[i].setId(i);
       rgroup.addView(rb[i]);           
  }       
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!