how to generate dynamic RadioButton with a radiongroup in adapterView?

后端 未结 1 548
名媛妹妹
名媛妹妹 2021-01-07 03:59

I have a Dynamic list..

I want to show that list in adapter view with radio buttons. in one group.

I used:

public class Type2Adapter extends          


        
1条回答
  •  一生所求
    2021-01-07 04:22

       
       
    
    //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]);           
      }       
    

    0 讨论(0)
提交回复
热议问题