Android examples for User Interface:View Child
get All Child View
import java.util.ArrayList; import java.util.List; import android.view.View; import android.view.ViewGroup; public class Main { public static List<View> getAllChildView(View view) { List<View> allChildView = new ArrayList<View>(); if (view instanceof ViewGroup) { ViewGroup vg = (ViewGroup) view;// ww w. j a va 2 s . co m for (int i = 0; i < vg.getChildCount(); i++) { View viewChild = vg.getChildAt(i); allChildView.add(viewChild); allChildView.addAll(getAllChildView(viewChild)); } } return allChildView; } }