Can I get all EditText of an android layout at once?

android, android-edittext

Solution

Try using ViewGroup

 ViewGroup group = (ViewGroup)findViewById(R.id.your_group);
for (int i = 0, count = group.getChildCount(); i < count; ++i) {
    View view = group.getChildAt(i);
    if (view instanceof EditText) {
        ((EditText)view).setText("");//here it will be clear all the EditText field
    }
}

Problem

Can I get all EditText of android layouts along with there ids,values on a click event or on load so that I can update text dynamically. Thanks In Advance. Edited - I am using dynamic form generator script from here http://labs.makemachine.net/2010/04/android-form-generator/ Which works fine....it has a default option so i can set default value too. What I wanna do it to change its fields value through code once it is loaded. But i can not understand how to select those fields. So asking how can get all editText with there ID from a form.

Original source