Java tutorial
//package com.java2s; import android.view.ViewGroup; import android.widget.EditText; import android.widget.RadioGroup; public class Main { public static boolean IsFormCompleted(ViewGroup v) { for (int i = 0; i < v.getChildCount(); i++) { Object child = v.getChildAt(i); if (child instanceof EditText) { EditText e = (EditText) child; if (e.getText().length() == 0) return false; } else if (child instanceof RadioGroup) { RadioGroup rb = (RadioGroup) child; if (rb.getCheckedRadioButtonId() < 0) return false; } } return true; } }