Get the array of RadioButtons in a RadioGroup in Android

后端 未结 2 540
谎友^
谎友^ 2020-12-05 17:30

Is there any way of getting an array (or a collection) of the RadioButtons in an Android RadioGroup? I would like to add individual listeners to ra

2条回答
  •  既然无缘
    2020-12-05 18:24

    this should do the trick:

            int count = radioGroup.getChildCount();
            ArrayList listOfRadioButtons = new ArrayList();
            for (int i=0;i

提交回复
热议问题