Java tutorial
//package com.java2s; //License from project: Apache License import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.LinearLayout; public class Main { public static void clearAllEdits(ViewGroup group) { if (group != null) { int count = group.getChildCount(); for (int i = 0; i < count; ++i) { View view = group.getChildAt(i); if (view instanceof EditText) { ((EditText) view).setText(""); } else if (view instanceof LinearLayout) { clearAllEdits((ViewGroup) view); } } } } }