Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.view.View;

import android.widget.RadioButton;
import android.widget.RadioGroup;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<RadioButton> getRadioButtons(RadioGroup radioGroup) {
        final ArrayList<RadioButton> out = new ArrayList<>(radioGroup.getChildCount());
        for (int i = 0; i < radioGroup.getChildCount(); i++) {
            final View v = radioGroup.getChildAt(i);
            if (v instanceof RadioButton) {
                out.add((RadioButton) v);
            }
        }
        return out;
    }
}