Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

android iterate through radio group java

int count = radioGroup.getChildCount();
ArrayList<RadioButton> listOfRadioButtons = new ArrayList<RadioButton>();
for (int i=0;i<count;i++) {
  View o = radioGroup.getChildAt(i);
  if (o instanceof RadioButton) {
    listOfRadioButtons.add((RadioButton)o);
  }
}
Log.d(TAG,"you have "+listOfRadioButtons.size()+" radio buttons");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #android #iterate #radio #group #java
ADD COMMENT
Topic
Name
1+6 =