Android examples for User Interface:ViewGroup
clear All Edits from ViewGroup
//package com.java2s; 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); }//from www . ja v a 2s. c o m } } } }